Why my code shows did I account for negative values

#include
using namespace std;
int main() {
int N;
cin>>N;

if(N>0){
	//cout<<"\n";
    cout <<N;
	cout<<"\n";
}
int cs = N;
while(cs>0)
{
    int t ;
    cin >> t ;
    cs += t ;
	//cout<<"\n";
    if(cs>=0)
    cout<<t;
	cout<<"\n";
}

return 0;

}

hi @deepshreyamishra301_1918130c8477386b, just make it N>=0 and cs>=0 in , as it says to stop only if negative

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.