Pascal: program Project; var a,b,c: integer; min, max: integer; begin Write('a='); Readln(a); Write('b='); Readln(b); Write('c='); Readln(c); if (a>b) and (a>c) then begin max:=a; if b>c then begin a:=c; c:=max; end else begin a:=b; b:=max; end end else begin if (b>a) and (b>c) then begin max:=b; if a>c then begin b:=c; c:=max; end else begin b:=a; a:=max; end end else begin max:=c; if a>b then begin c:=b; b:=max; end else begin c:=a; a:=max; end end end; Write('a=',a); Write('b=',b); Write('c=',c) end.
program Project;
var
a,b,c: integer;
min, max: integer;
begin
Write('a=');
Readln(a);
Write('b=');
Readln(b);
Write('c=');
Readln(c);
if (a>b) and (a>c) then
begin
max:=a;
if b>c then
begin
a:=c;
c:=max;
end
else
begin
a:=b;
b:=max;
end
end else
begin
if (b>a) and (b>c) then
begin
max:=b;
if a>c then
begin
b:=c;
c:=max;
end
else
begin
b:=a;
a:=max;
end
end else
begin
max:=c;
if a>b then
begin
c:=b;
b:=max;
end
else
begin
c:=a;
a:=max;
end
end
end;
Write('a=',a);
Write('b=',b);
Write('c=',c)
end.
Код написал на Python:
Рандомная строка из букв, цифр и знаков пунктуации:
import random
chars = "0123456789r!'#$%&()*+,-./:;<=>[email protected][\]^_`{|}~"
len_chars = len(chars)
str_result = ""
for i in range(10):
r_number = random.randint(0,len_chars)
str_result = str_result + chars[r_number]
print(str_result)
Проверка на цифры в строке (если будете считать как новую задачу, то знайте, кусок кода взял из первой для генерации случайной строки):
import random
chars = "0123456789r!'#$%&()*+,-./:;<=>[email protected][\]^_`{|}~"
len_chars = len(chars)
str_result = ""
for i in range(10):
r_number = random.randint(0,len_chars)
str_result = str_result + chars[r_number]
print(str_result)
counter = 0
for i in range(10):
if (i == 9):
if (str_result[i].isnumeric() == False):
print("There is no numbers in string")
else:
if (str_result[i].isnumeric() == True):
print("There is at least one number in string")
break
else:
continue