Variable length input

question
SIMPLE INPUT
Given a list of numbers, stop processing input after cummulative sum of all the input becomes negative.

Input Format:
A list of integers

Constraints:
All numbers input are integers between -1000 and 1000.

Output Format
All the numbers before the cummulative sum become zero in a new line.

Sample Input
1 2 88 -100 49

Sample Output
1 2 88
DOUBT
my solution-https://ide.codingblocks.com/#/s/31029
doubt 1- one out of 3 test cases fail.
doubt 2- is there any other way to take input in such questions, in which we don’t know the exact counting of numbers user will insert.

https://ide.codingblocks.com/#/s/31071

I have made the changes and added the comments. An alternative way is also provided for such questions.