#include
int main()
{
int a[80],i,b=0;
for(i=0;i<=80;i++)
{scanf("%d",&a[i]);
if (a[i]>0) b=b+a[i];
else break;}
printf("%d",b);
}
#include
int main(void)
{
int i=1,sum=0;
printf("请输入整数,回车确定\n");
for(;;)
{
if(i>0)
{scanf("%d",&i);
sum=sum+i;
}
else
break;
}
printf("%d\n",sum);
return 0;
}
int function()
{
int i = 0, sum = 0;
for (;;)
{
scanf("%d", &i);
if (i <= 0)
break;
sum += i;
}
return sum;
}