首页 > ACM题库 > HDU-杭电 > HDU 1093 A+B for Input-Output Practice (V)[解题报告] C++
2013
11-27

HDU 1093 A+B for Input-Output Practice (V)[解题报告] C++

A+B for Input-Output Practice (V)

问题描述 :

Your task is to calculate the sum of some integers.

输入:

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.

输出:

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.

样例输入:

2
4 1 2 3 4
5 1 2 3 4 5

样例输出:

10
15

2011-12-12 04:51:00

地址:http://acm.hdu.edu.cn/showproblem.php?pid=1093

题意:还是n个数的和,一共T组:

mark:和1092只差一点点。

代码(C编译):

main(n,a,b){scanf("%d",&n);while(~scanf("%d",&n)&&n){b=0;while(n--){scanf("%d",&a);b+=a;}printf("%d\n",b);}}


  1. 站长,你好!
    你创办的的网站非常好,为我们学习算法练习编程提供了一个很好的平台,我想给你提个小建议,就是要能把每道题目的难度标出来就好了,这样我们学习起来会有一个循序渐进的过程!