Добавить в корзинуПозвонить
Найти в Дзене

№17

№17 f = open('17.txt') a = [int(s) for s in f] ans = [] max19 = max([s for s in a if abs(s) % 100 == 19]) for i in range(len(a) - 1): x, y = a[i], a[i+1] if ((10 <= abs(x) <= 99) + (10 <= abs(y) <= 99)) == 1: if (x + y) > max19: ans.append(x + y)

№17

f = open('17.txt')

a = [int(s) for s in f]

ans = []

max19 = max([s for s in a if abs(s) % 100 == 19])

for i in range(len(a) - 1):

x, y = a[i], a[i+1]

if ((10 <= abs(x) <= 99) + (10 <= abs(y) <= 99)) == 1:

if (x + y) > max19:

ans.append(x + y)