C语言编程题
刚一个下午一直在做这样一个题目Input contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M integers follow in the same line.
Output
For each group of input integers you should output their sum in one line, and you must note that there is a blank line between outputs.
Sample Input
3
4 1 2 3 4
5 1 2 3 4 5
3 1 2 3
Sample Output
10
15
6
然后我的程序是这样的
#include<stdio.h>
void main ()
{
int i,j,t,a,b,s[100];
for(i=0;i<100;i++)s[i]=0;
scanf("%d",&t);
for(i=0;i<t;i++)
{
scanf("%d",&j);
for(a=0;a<j;a++)
{
scanf("%d",&b);
s[i]+=b;
}
}
for(i=0;i<t;i++)
{
printf("%d",s[i]);
if(i!=t-1)printf("\n\n");
}
}
我发到网站上显示presentation error
这个题目我知道可能是鸡蛋里挑骨头的题目,但是老师要求做,也没办法。。。哎 大家帮个忙哈。