Skip to content
Sign upLog in
← Back to Community

6.B. While: Greater than previous

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 number of elements of the sequence that are greater than their neighbors above.

Example input
1
2
3
4
5
0

Example output
4

Voters
Profile icon
AddisonLeonard
Profile icon
tomsfy
Profile icon
pole55