Share your repls and programming experiences

← Back to all posts
6.B. While: Greater than previous
pole55 (210)

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