uses Graphabc;
begin
SetwindowWidth(600);
setwindowheight(400);
SetPenWidth(2);
setpencolor(clblack);
circle(500,100,50);
floodfill(500,100,clyellow);
line(250,100,300,50);
line(300,50,350,100);
line(350,100,250,100);
floodfill(300,70,clgreen);
line(225,200,300,100);
line(300,100,375,200);
line(375,200,225,200);
floodfill(300,150,clgreen);
line(200,300,300,200);
line(300,200,400,300);
line(400,300,200,300);
floodfill(300,250,clgreen);
rectangle(285,300,315,325);
floodfill(300,310,clbrown);
line(0,300,100,350);
line(100,350,200,325);
line(200,325,400,325);
line(400,325,600,375);
line(600,375,2000,375);
floodfill(50,350,clgreen);
end.
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 делать не стоит, сайт нарушает табуляции в коде.
uses Graphabc;
begin
SetwindowWidth(600);
setwindowheight(400);
SetPenWidth(2);
setpencolor(clblack);
circle(500,100,50);
floodfill(500,100,clyellow);
line(250,100,300,50);
line(300,50,350,100);
line(350,100,250,100);
floodfill(300,70,clgreen);
line(225,200,300,100);
line(300,100,375,200);
line(375,200,225,200);
floodfill(300,150,clgreen);
line(200,300,300,200);
line(300,200,400,300);
line(400,300,200,300);
floodfill(300,250,clgreen);
rectangle(285,300,315,325);
floodfill(300,310,clbrown);
line(0,300,100,350);
line(100,350,200,325);
line(200,325,400,325);
line(400,325,600,375);
line(600,375,2000,375);
floodfill(50,350,clgreen);
end.
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 делать не стоит, сайт нарушает табуляции в коде.