Share your repls and programming experiences

← Back to all posts
6.5. While: Length of sequence
pole55 (83)

Given a sequence of non-negative integers, where each number is written in a separate line. Determine the length of the sequence. The sequence ends with 0. Print the length of the sequence (not counting the 0). The numbers following the number 0 should be omitted.

Example input
1
7
9
0
5

Example output
3