Sum Until Zero

JavaScript Easy 4 views
Back to Questions

Problem Description

Input has integers separated by spaces/new lines. Keep adding until you see 0. Print the sum (0 is not included).

Input Format

Many integers (space/newline).

Output Format

One integer sum.

Sample Test Case

Input:
5 2 -3 10 0 99
Output:
14

Constraints

At least one 0 will appear.

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next