1107题怎么做?我的打法老是pe。bulid by Mars123123 at 2017-12-08 22:57
Rating:-
1 reply by Mars123123 at 2017-12-08 23:05
Rating:-

#include<stdio.h>

int main()

{

int a,b,n,sum;

scanf("%d",&n);

while(n--)

{

scanf("%d",&a);

sum=0;

while(a--)

{

scanf("%d",&b);

sum+=b;

    }

    printf("%d\n",sum);

}

return 0;

}

lcj666(梦中人):

#include int main() { int n, m, a, sum; scanf("%d", &n); while(n) { scanf("%d", &m); sum = 0; while(m) { scanf("%d", &a); sum = sum + a; m--; } printf("%d\n", sum); n--; } return 0; } 不行啊,快炸了

2018-03-04 22:37 回复
2 reply by Mars123123 at 2017-12-08 23:06
Rating:-

#include<stdio.h>

int main()

{

int a,b,n,sum;

scanf("%d",&n);

while(n--)

{

scanf("%d",&a);

sum=0;

while(a--)

{

scanf("%d",&b);

sum+=b;

    }

    printf("%d\n",sum);

}

return 0;

}

3 reply by Mars123123 at 2017-12-08 23:25
Rating:-

#include<stdio.h>

int main()

{

int a,b,n,sum;

scanf("%d",&n);

while(n--)

{

scanf("%d",&a);

sum=0;

while(a--)

{

scanf("%d",&b);

sum+=b;

    }

    if(n==0)

    printf("%d",sum);

    else

    printf("%d\n",sum);

}

return 0;

}

1211749568(Hang☆):

每个数据都要换行,然后每两个还要一个换行,所以要输出两个换行,但是最后一个后面应只有一个换行,写个特判就过了

2018-05-21 20:42 回复
4 reply by ゞ、赤琦 at 2017-12-11 18:25
Rating:1254

emmmmmmmmmmmm.............去群里问吧 这里基本没人看

回复
要回复,请先登录

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: