Problem Description

Your task is to Calculate the sum of some integers.

Input

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.

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

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

Sample Output

10
15
#include <iostream>
using namespace std; int main()
{
int N;
while(cin >> N && N )
{
int sum = ;
while (N--)
{
int i;
cin >> i;
sum += i;
}
cout << sum << endl;
} return ;
}

武汉科技大学ACM :1004: A+B for Input-Output Practice (IV)的更多相关文章

  1. 武汉科技大学ACM :1001: A+B for Input-Output Practice (I)

    Problem Description Your task is to Calculate a + b. Too easy?! Of course! I specially designed the ...

  2. 武汉科技大学ACM :1008: A+B for Input-Output Practice (VIII)

    Problem Description Your task is to calculate the sum of some integers. Input Input contains an inte ...

  3. 武汉科技大学ACM :1007: A+B for Input-Output Practice (VII)

    Problem Description Your task is to Calculate a + b. Input The input will consist of a series of pai ...

  4. 武汉科技大学ACM :1006: A+B for Input-Output Practice (VI)

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

  5. 武汉科技大学ACM :1005: A+B for Input-Output Practice (V)

    Problem Description Your task is to calculate the sum of some integers. Input Input contains an inte ...

  6. 武汉科技大学ACM :1003: A+B for Input-Output Practice (III)

    Problem Description Your task is to Calculate a + b. Input Input contains multiple test cases. Each ...

  7. 武汉科技大学ACM :1002: A+B for Input-Output Practice (II)

    Problem Description Your task is to Calculate a + b. Input Input contains an integer N in the first ...

  8. 武汉科技大学ACM:1006: 我是老大

    Problem Description 今年是2021年,正值武汉科技大学 ACM俱乐部成立10周年.十周年庆祝那天,从ACM俱乐部走出去的各路牛人欢聚一堂,其乐融融.庆祝晚会上,大家纷纷向俱乐部伸出 ...

  9. 武汉科技大学ACM:1005: Soapbear and Honey

    Problem Description Soapbear is the mascot of WHUACM team. Like other bears, Soapbear loves honey ve ...

  10. 武汉科技大学ACM:1004: Lake and Island

    Problem Description 北园孩子的专属福利来啦~学校从北区宿舍到湖心岛修建了一条通道让北园的同学们可以上去一(kuang)同(xiu)玩(en)耍(ai),这一天,IcY向ahm001 ...

随机推荐

  1. 初谈使用Spring的感受

    我记得刚开始学Spring的时候,只是很自然的把它当做一个类似其他J2EE的框架来学习.那时候学Spring很大一部分是为了以后面试需要,因为毕竟搞Java的,你说不会Spring这都有点说不过去.当 ...

  2. ExtJS5_主界面上加入顶部和底部区域

    为主界面加一个顶部区域和底部区域.一个管理系统的界面可以粗分为顶部标题部分.中间数据展示和处理的部分.底部备注和状态部分. 在增加这二个区域之前,我们先在MainModel.js中加入一些数据. Ex ...

  3. 异步导入导出Redis数据(利用Hiredis、Libevent)

    最近工作中需要用到一个将数据从Redis导出到文本(或从文本导入Redis)的工具.找到一个用Ruby写的开源软件redis-dump(http://delanotes.com/redis-dump/ ...

  4. AnimationDrawable 资源

    AnimationDrawable代表一个动画,Android 既支持传统的逐帧动画(类 似于电影方式,一张图片.一张图片地切换),也支持通过平移.变换计算出来的补间动画. 下面以补间动画为例来介绍如 ...

  5. COJ 2024 仙境传奇(五)——一个天才的觉醒 素数筛

    整理模板,同时测了一下memset,for,fill到底谁快... 结果:memset最快,其次是for,fill最慢QAQ.... #include<iostream> #include ...

  6. 实Schur分解

        前面已经说过LU,Cholesky和QR分解,这次介绍的是实Schur分解.对这个分解的定义是任意一个矩阵A,可有如下形式的分解:               U*A*U' = B;其中B是拟 ...

  7. SKPhysicsContact类

    继承自 NSObject 符合 NSObject(NSObject) 框架  /System/Library/Frameworks/SpriteKit.framework 可用性 可用于iOS 7.0 ...

  8. (五)unity4.6Ugui中文教程文档-------概要-UGUI Interaction Components

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMDAxOTcxNw==/font/5a6L5L2T/fontsize/400/fill/I0JBQk ...

  9. mysql 数据库连接(远程和本地原理同样)

    mysql 连接远程数据库的时候的格式 mysql -uuser -hhost -Pport -ppassword

  10. shell 死循环

      例1: 运行脚本后会自动加载firefox浏览器,并打开指定网页.如果用户关闭firefox,脚本会再次自动重新打开firefox.     如需结束循环,中止t2.sh进程即可.注意不要同时执行 ...