Cant understand the problem, this is what i understand
#include
using namespace std;
int main() {
int n;
int sum=0;
while(scanf("%d",&n)!=EOF)
{
//cout<<n<<endl;
while(sum>=0)
{
sum=sum+n;
if(sum<0)
{
break;
}
}
if( n<0)
{
break;
}
cout<<n<<endl;
}
return 0;
}