Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lst = []
- n = int(input())
- i = 0
- while (i<n):
- a = int(input())
- lst.append(a)
- if len(lst) is 1:
- print(lst[0])
- else:
- lst.sort()
- if len(lst)%2 == 0:
- print((lst[len(lst)//2] + lst[len(lst)//2 - 1]) // 2)
- else:
- print(lst[len(lst) // 2])
- i+=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement