Answer :
int main(void){
int n,s=0;
while(1){
scanf(" %d",&n);
if(n<0) break;
s+=n;
}
printf("sum=%d\n",s);
return 0;
}
int n,s=0;
while(1){
scanf(" %d",&n);
if(n<0) break;
s+=n;
}
printf("sum=%d\n",s);
return 0;
}