Maximum
You are given
N number of inputs. Print the maximum of them after each input.Input
The first line of input is an integer
N. The next N lines each contain an integer as input.Explanation
In the example, you are given
6 inputs 1, 0, 3, 2, 9, 8.
1 is maximum in the input 1.
1 is maximum in the input 1, 0.
3 is maximum in the input 1, 0, 3.
3 is maximum in the input 1, 0, 3, 2.
9 is maximum in the input 1, 0, 3, 2, 9.
9 is maximum in the input 1, 0, 3, 2, 9, 8.
So, the output should be
1
3
3
9
9
input
4
10
9
8
7
output should be
10
9
9
9
n = int(input())
line = []
for i in range(0, n):
line.append(input())
print(max(line))
# print(f'{max(line)} is maximum in the input {", ".join(line)}')
Comments
Leave a comment