Given a list of numbers, stop processing input after the cumulative sum of all the input becomes negative.
Input Format
A list of integers to be processed
Constraints
All numbers input are integers between -1000 and 1000.
Output Format
Print all the numbers before the cumulative sum become negative.
Sample Input
1
2
88
-100
49
Sample Output
1
2
88
Code Editor
Choose Language
Java 8
Provide Custom Input
Compile and Test Submit Code
1
2
88
-100
49
Failed Testcases
Dang! You couldn’t score a perfect 100 because you failed one or more testcases. This means that your program didn’t account for all input cases (did you account for negative numbers, for example?).
Test Cases
Result
Test Case 0 right
Test Case 1 wrong
Test Case 2 wrong
Test Case 3 right
Compile Message
Success