落絮飞雁

顺流而下,把梦做完

【ACM】ACM steps 1.1.5*

A+B for Input-Output Practice (V)

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 18072 Accepted Submission(s): 13110

Problem Description
Your task is to calculate the sum of some integers.

Input
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 with one line of output for each line in input.

Sample Input
2
4 1 2 3 4
5 1 2 3 4 5

Sample Output
10
15

Author
lcy

参考题解:

#include
int main()
{
    int n,a,b,i,j,sum;
    sum=0;
    while(scanf("%dn",&n)!=EOF)
    {
        for(i=0;i

唔,九点了。感觉有点不在状态。本来打算今天刷完第一系列的,现在看看能刷到多少吧……
这道题也不是很难,尤其是有前一题做铺垫,注意有时候该写注释的写注释,定义的变量太多的话自己会晕掉的= =  。还有就是要注意最后还要对sum进行初始化。


原文标题:【ACM】ACM steps 1.1.5*|落絮飞雁的个人网站
原文链接:https://www.luoxufeiyan.com/2013/10/26/%e3%80%90acm%e3%80%91acm-steps-1-1-5/
授权协议:创作共用 署名-非商业性使用 2.5 中国大陆
除注明外,本站文章均为原创;转载时请保留上述链接。