#include<stdio.h>
int main()
{
int m,n,i,sum;
scanf("%d",&m);
for(i=1;i<=m;i++)
{
sum=0;
while(1)
{
scanf("%d",&n);
sum=sum+n;
if(getchar()==‘\n‘)break;
}
printf("%d\n",sum);}
return 0;
}
>ch -u "A+B for Input-Output Practice 3.ch"
2
4 1 2 3 4
14
5 1 2 3 5
16
>Exit code: 0
时间: 2024-12-22 07:35:57