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

HDU 1092 A+B for Input-Output Practice (IV)简单[解题报告] C++

A+B for Input-Output Practice (IV)

问题描述 :

Your task is to Calculate the sum of some integers.

输入:

Input contains multiple test cases. Each test case contains a integer N, and then N integers follow in the same line. A test case starting with 0 terminates the input and this test case is not to be processed.

输出:

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.

样例输入:

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

样例输出:

10
15

2011-12-12 04:49:22

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

题意:每行第一个数是n,之后n个数。计算和。

mark:没老老实实写,贡献了一个CE。

代码(C编译):

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


  1. 站长好。我是一个准备创业的互联网小白,我们打算做一个有关国*际*游*学的平台。手上也有了一些境外资源。现阶段的团队现在没有cto.原意出让一些管理股寻找一个靠谱的技术专家做合伙人, 不知道是不是能得到您的帮助。发个帖子或者其他方式。期待您的回应。可以加我微信tianxielemon聊聊。

  2. Excellent Web-site! I required to ask if I might webpages and use a component of the net web website and use a number of factors for just about any faculty process. Please notify me through email regardless of whether that would be excellent. Many thanks

  3. Thanks for taking the time to examine this, I really feel strongly about it and love studying a lot more on this topic. If possible, as you acquire experience