Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- arr = []
- a = 1
- i = 0
- maxx = -999
- secondMax = -999
- while a != 0:
- a = int(input())
- arr.append(a)
- i = i + 1
- for x in range(0, i):
- if maxx < arr[x]:
- maxx = arr [x]
- for x in range(0, i):
- if secondMax < arr[x] and arr[x] < maxx:
- secondMax = arr[x]
- if secondMax == 0 or secondMax == -999:
- print(0)
- else:
- print(secondMax)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement