N = int(input())
Speed_limit_car_count = 0
all_speed = 0
car_speed = []
i = 0
total = None
YN = None
def list_check(car_speed):
for i in range(len(car_speed)):
if car_speed[i] in range(1, 300):
normal = True
continue
else:
normal = False
break
return normal
if N not in range(1, 31):
print('Wrong input')
while i < N:
car_speed.append(float(input()))
i += 1
normal = list_check(car_speed)
if normal:
if car_speed[i] <= 30:
Speed_limit_car_count += 1
round(car_speed[i])
all_speed += car_speed[i]
total = all_speed/N
if Speed_limit_car_count >= 2:
YN = 'YES'
YN = 'NO'
print('ERROR IN SPEEDLIST. CHEK INPUT!')
print(total, YN)
Программа протестирована. ctrl+c делать не стоит, сайт нарушает табуляции в коде.
var
a: integer;
begin
{1}
readln(a);
if a > 0 then a := a + 1;
writeln(a);
{2}
if a < 0 then a := a * 2;
{3}
if a <> 0 then a := a - 4;
{4}
if a > 0 then a := a + 1
else a := a - 1;
{5}
if a = 0 then a := a + 3
else a := 0;
end.
{6}
x, y: real;
readln(x, y);
if x > y then x := x * y
else x := x + y;
writeln(x);
N = int(input())
Speed_limit_car_count = 0
all_speed = 0
car_speed = []
i = 0
total = None
YN = None
def list_check(car_speed):
for i in range(len(car_speed)):
if car_speed[i] in range(1, 300):
normal = True
continue
else:
normal = False
break
return normal
if N not in range(1, 31):
print('Wrong input')
else:
while i < N:
car_speed.append(float(input()))
i += 1
normal = list_check(car_speed)
if normal:
for i in range(len(car_speed)):
if car_speed[i] <= 30:
Speed_limit_car_count += 1
for i in range(len(car_speed)):
round(car_speed[i])
all_speed += car_speed[i]
total = all_speed/N
if Speed_limit_car_count >= 2:
YN = 'YES'
else:
YN = 'NO'
else:
print('ERROR IN SPEEDLIST. CHEK INPUT!')
print(total, YN)
Программа протестирована. ctrl+c делать не стоит, сайт нарушает табуляции в коде.
var
a: integer;
begin
{1}
readln(a);
if a > 0 then a := a + 1;
writeln(a);
{2}
readln(a);
if a < 0 then a := a * 2;
writeln(a);
{3}
readln(a);
if a <> 0 then a := a - 4;
writeln(a);
{4}
readln(a);
if a > 0 then a := a + 1
else a := a - 1;
writeln(a);
{5}
readln(a);
if a = 0 then a := a + 3
else a := 0;
writeln(a);
end.
{6}
var
x, y: real;
begin
readln(x, y);
if x > y then x := x * y
else x := x + y;
writeln(x);
end.