Find the sum of all elements in a sequence, ending with 0.
The number 0 itself is not included in the sequence and serves as a sign that the sequence ended. Although, if you add 0, nothing bad will happen :)
Find the sum of all elements in a sequence, ending with 0.
The number 0 itself is not included in the sequence and serves as a sign that the sequence ended. Although, if you add 0, nothing bad will happen :)
Sample Input 1:
3
6
8
0Sample Output 1:
17Create a free account to access the full topic