1)
number_list = []
for i in range(4):
number_list.append(int(input()))
print('максимальное число: ' + str(max(number_list)))
print('минимальное число: ' + str(min(number_list)))
2)
first_list = [int(input()) for n in range(3)]
second_list = []
for number in first_list:
second_list.append(number)
first_list.sort()
if first_list == second_list:
print('по росту .')
else:
print('не по росту !')
3)
month_ask = str(input())
if month_ask in ['12', '1', '2', '01', '02']:
print('Зима .')
elif month_ask in ['3', '4', '5', '03', '04', '05']:
print('Весна .')
elif month_ask in ['6', '7', '8', '06', '07', '08']:
print('Лето .')
elif month_ask in ['9', '10', '11', '09']:
print('Осень .')
4)
number = str(input())
if len(number) == 3:
print('Верно .')
print('Не верно .')
5)
first_list = []
for n in number:
first_list.append(n)
for i in first_list:
second_list.append(i)
first_list.reverse()
print(first_list)
print(second_list)
print('Не верно')
PascalABC.NET
#1
begin
PartitionPoints(-10, 10, 20).Tabulate(p -> 5*(p**2) + 2*p).Println;
end.
#2
var A := ReadSeqIntegerWhile(p -> p <> 0).ToList;
var x := ReadInteger('Считаем это число: ');
A.Where(p -> p = x).Count.Println;
#3
function IsNumberContainsDigit(number:integer; digit: char):boolean;
var stringnumber := number.ToString;
if stringnumber.contains(digit) then IsNumberContainsDigit:=True else IsNumberContainsDigit := False
end;
var (a, b) := ReadInteger2('a, b: ');
var rng := Range(a, b);
rng.Where(p->IsNumberContainsDigit(p, '0')).Print;
Объяснение:
1)
number_list = []
for i in range(4):
number_list.append(int(input()))
print('максимальное число: ' + str(max(number_list)))
print('минимальное число: ' + str(min(number_list)))
2)
first_list = [int(input()) for n in range(3)]
second_list = []
for number in first_list:
second_list.append(number)
first_list.sort()
if first_list == second_list:
print('по росту .')
else:
print('не по росту !')
3)
month_ask = str(input())
if month_ask in ['12', '1', '2', '01', '02']:
print('Зима .')
elif month_ask in ['3', '4', '5', '03', '04', '05']:
print('Весна .')
elif month_ask in ['6', '7', '8', '06', '07', '08']:
print('Лето .')
elif month_ask in ['9', '10', '11', '09']:
print('Осень .')
4)
number = str(input())
if len(number) == 3:
print('Верно .')
else:
print('Не верно .')
5)
number = str(input())
first_list = []
for n in number:
first_list.append(n)
second_list = []
for i in first_list:
second_list.append(i)
first_list.reverse()
print(first_list)
print(second_list)
if first_list == second_list:
print('Верно .')
else:
print('Не верно')
PascalABC.NET
#1
begin
PartitionPoints(-10, 10, 20).Tabulate(p -> 5*(p**2) + 2*p).Println;
end.
#2
begin
var A := ReadSeqIntegerWhile(p -> p <> 0).ToList;
var x := ReadInteger('Считаем это число: ');
A.Where(p -> p = x).Count.Println;
end.
#3
function IsNumberContainsDigit(number:integer; digit: char):boolean;
begin
var stringnumber := number.ToString;
if stringnumber.contains(digit) then IsNumberContainsDigit:=True else IsNumberContainsDigit := False
end;
begin
var (a, b) := ReadInteger2('a, b: ');
var rng := Range(a, b);
rng.Where(p->IsNumberContainsDigit(p, '0')).Print;
end.
Объяснение: