how to take inputs? the question says take a list of numbers , is this to be predefined
#include
using namespace std;
int main()
{
int a[]={1,2,88,-100,49};
int sum=0;
int i=0;
int s=sizeof(a)/sizeof(a[0]);
while (i<s)
{
sum=sum+a[i];
if(sum>=0)
{
cout<<a[i]<<endl;
i++;
}
else
{
break;
}
}
}
this is my take on the question, but on submitting no test case pass