2 4 1 2 3 4 5 1 2 3 4 5
10 15
#include < stdio.h >
int main()
{
int a, b, c, d, i, j;
scanf("%d", &a);
getchar();
for(i = 0; i < a; i++)
{
scanf("%d", &b);
d = 0;
for(j = 0; j < b; j++)
{
scanf("%d", &c);
d = c + d;
}
printf("%d\n", d);
}
}
00185482 2007-02-05 22:53:03 Accepted 1093 16 MS 152 KB 314 B GNU C 俺是菜鸟
#include < stdio.h >
int main()
{
int a, b, c, i;
scanf("%d", &a);
getchar();
for(i = 0; i < a; i++)
{
c = 0;
while(getchar()!='\n')
{
scanf("%d", &b);
c = c + b;
}
printf("%d\n", c);
}
}
00185446 2007-02-05 22:15:43 Time Limit Exceeded 1093 1019 MS 140 KB 240 B GNU C 俺是菜鸟
Faint. While may keep on waiting uninterruptedly for the next input, which takes much more time.
Remember that.