Simple input _problem _getting error

In my editor everython goes riht but during submission getting error what is wrong with that
#include
using namespace std;
int main()
{

 int A;

long int ans=0;


for(int cnt=1; ;cnt++)
{
	cin>> A ;
			ans +=A;
		
			if(ans >= 0)
			{
				cout<<A<<endl;
			
			}
			else
			{
				break;
			}	
}	
return 0;

}

@farid.chorshanbiev its passing all the cases . i think you submitted a other code there
dont forget to hit like and mark resolved if cleared :smiley: