Акинин Евгений Алексеевич 525 гр. SecondMax 1155 | Александр Цехмистер, 527 группа SecondMax 734 | ||||
---|---|---|---|---|---|
t | 1 | max1 = int(input()) | t | 1 | max = int(input()) |
2 | max2 = 'NO' | 2 | second_max = 'NO' | ||
3 | while (a := int(input())): | 3 | while (el := int(input())): | ||
4 | if a > max1: | 4 | if el > max: | ||
5 | max2 = max1 | 5 | second_max = max | ||
6 | max1 = a | 6 | max = el | ||
7 | elif a < max1 and (max2 == 'NO' or max2 < a): | 7 | elif el < max and (second_max == 'NO' or second_max < el): | ||
8 | max2 = a | 8 | second_max = el | ||
9 | print(max2) | 9 | print(second_max) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|