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")
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")
var
s: string[6];
n: integer;
begin
s := 'отлично';
n := length(s);
writeln(length('отлично'));
writeln(n);
end.
Изначально выставлен тип string[6], значит если присвоить строку больше, то ее обрежет по 6 символов, вот и весь прикол
ответ 6
2) рисунок
3)var
s, s1: string;
n: integer;
begin
s := 'информатика';
s1 := copy(s, 3, 5);
n := pos(s, s1);
writeln('s=', s);
writeln('s1=', s1);
writeln('n=', n);
end.
Вывод
s=информатика
s1=форма
n=0
Все верно, в s1 не содержится s, а наоборот