1.
def func(x,y,xc,yc,r):
return (x - xc)**2+ (y - yc)**2 <= r**2
x=float(input())
y=float(input())
xc=float(input())
yc=float(input())
r=float(input())
if func(x, y, xc, yc, r):
print("YES")
else:
print("NO")
2.
with open("input.txt") as f:
massiv=list(map(int,f.read().split("\n")))
with open("output.txt","w") as f:
for i in massiv:
if i==3:
f.write("win\n")
elif i==1:
f.write("draw\n")
elif i==0:
f.write("lose\n")
3.
if massiv[0]>massiv[1]:
f.write("Alexander is the eldes.")
elif massiv[0]<massiv[1]:
f.write("Tatyana is the eldest.")
f.write("Nobody is the eldest.")
4.
massiv=list(map(float,f.read().split("\n")))
if i<=0:
f.write("ice\n")
elif i>=100:
f.write("water vapor\n")
f.write("water\n")
5.
with open("output.txt", "w") as f:
for i in range(0,len(massiv), 2):
if massiv[i]/massiv[i+1]<=1:
f.write("Traffic rules are executed. \n")
f.write("Traffic rules are not met. \n")
Код программы:
procedure print(a, b:integer);
var i:integer;
begin
for i:=1 to 7 do
write('*');
writeln();
for i:=1 to 19 do
for i:=1 to a do
for i:=1 to b do
end;
var a,b:integer;
writeln('Введите количество символов на 3 уровне(<80): ');
readln(a);
writeln('Введите количество символов на 4 уровне(<80): ');
readln(b);
if (a < 80) and (b < 80) then
print(a,b)
else
writeln('Ошибка! Количество символов >= 80');
end.
1.
def func(x,y,xc,yc,r):
return (x - xc)**2+ (y - yc)**2 <= r**2
x=float(input())
y=float(input())
xc=float(input())
yc=float(input())
r=float(input())
if func(x, y, xc, yc, r):
print("YES")
else:
print("NO")
2.
with open("input.txt") as f:
massiv=list(map(int,f.read().split("\n")))
with open("output.txt","w") as f:
for i in massiv:
if i==3:
f.write("win\n")
elif i==1:
f.write("draw\n")
elif i==0:
f.write("lose\n")
3.
with open("input.txt") as f:
massiv=list(map(int,f.read().split("\n")))
with open("output.txt","w") as f:
if massiv[0]>massiv[1]:
f.write("Alexander is the eldes.")
elif massiv[0]<massiv[1]:
f.write("Tatyana is the eldest.")
else:
f.write("Nobody is the eldest.")
4.
with open("input.txt") as f:
massiv=list(map(float,f.read().split("\n")))
with open("output.txt","w") as f:
for i in massiv:
if i<=0:
f.write("ice\n")
elif i>=100:
f.write("water vapor\n")
else:
f.write("water\n")
5.
with open("input.txt") as f:
massiv=list(map(int,f.read().split("\n")))
with open("output.txt", "w") as f:
for i in range(0,len(massiv), 2):
if massiv[i]/massiv[i+1]<=1:
f.write("Traffic rules are executed. \n")
else:
f.write("Traffic rules are not met. \n")
Код программы:
procedure print(a, b:integer);
var i:integer;
begin
for i:=1 to 7 do
write('*');
writeln();
for i:=1 to 19 do
write('*');
writeln();
for i:=1 to a do
write('*');
writeln();
for i:=1 to b do
write('*');
end;
var a,b:integer;
begin
writeln('Введите количество символов на 3 уровне(<80): ');
readln(a);
writeln('Введите количество символов на 4 уровне(<80): ');
readln(b);
if (a < 80) and (b < 80) then
print(a,b)
else
writeln('Ошибка! Количество символов >= 80');
end.