# 17.8 из РТ
user_8840555
python
2 years ago
509 B
1
Indexable
f = open(r'C:\Users\SnowDrit\Downloads\17.8.txt') a = [] for s in f: a.append(int(s)) a6 = [] for i in range(len(a)): if str(a[i])[-1] == '6': a6.append(a[i]) m6 = min(a6) sp = [] for i in range(len(a) - 1): if (str(a[i])[-1] == str(a[i + 1])[-1]) and ((a[i] % 6 == 0 and a[i + 1] % 6 != 0) or ( a[i + 1] % 6 == 0 and a[i] % 6 != 0)) and (a[i] ** 2 + a[i + 1] ** 2) > m6 ** 2: sp.append(a[i] ** 2 + a[i + 1] ** 2) print(len(sp), max(sp)) # 17.8 из РТ
Editor is loading...