Share your repls and programming experiences

← Back to all posts
6.6. While: Sum of sequence
pole55 (199)

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

Example input
1
7
9
0

Example output
17