Simple input challange

I didn’t understand , how to take input till end file and want to know how to solve it without using brute force?

@Prateekkewale This is running stream and this can done by using a while loop
In the while loop the condition is true. So loop would be like this while(true). Break the loop as soon as cumulative sum becomes negative ie. You have to stop the working of this while loop when sum of all previous value become negative else you have to print the series of the previous input like sample data is like
1
2
88
-100
49
so 1+2+88-100=-9
so cumulative sum became negative
so series will print upto
1
2
88

Hope this helps :slightly_smiling_face:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.