#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

 

posted on 2017-11-07 15:58  鸵鸟tang  阅读(163)  评论(0编辑  收藏  举报