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