116
Объяснение:
d = 100
для k от 5 до 12 выполнить
Действия в цикле:
1) d = d - 6
2) d = d + 8
Вывод d
Цикл выполнится 8 раз
количество повторов в цикле равно конечное значение (12) переменной счётчика (k) минус начальное значение (5) переменной счётчика (k) плюс 1
количество повторов в цикле = 12 - 5 + 1 = 7 + 1 = 8
В цикле переменная d сначала уменьшается на 6, а затем увеличивается на 8.
В сумме эти действия () увеличивают переменную d на 2.
Следовательно за весь цикл переменная d увеличится на 2 * 8.
Т.к. в начале программы d = 100, то
d = 100 + 2 * 8 = 100 + 16 = 116
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")