Skip to content
← Back to Community
6.8. While: Maximum of sequence
Profile icon
pole55

Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the maximum of the sequence.

Example input
1
2
3
2
1
0

Example output
3

Voters
Profile icon
LUIS-ALEJANDR48
Profile icon
jairomera
Profile icon
MS10ZZ751663
Profile icon
DanielZ9
Profile icon
jsu0603
Profile icon
9ryee
Profile icon
EllenBussey
Profile icon
NS873915
Profile icon
bilgeylmz
Profile icon
h00326098