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. codevs 1709 钉子和小球

    1709 钉子和小球 1999年NOI全国竞赛 时间限制: 2 s 空间限制: 128000 KB 题目等级 : 大师 Master 题解 查看运行结果题目描述 Description有一个三角形木板 ...

  2. Tomcat基础教程(三)

    Tomcat中的Web应用 Web应用就是具有特定目录结构的目录和文件. 基于JAVA技术开发的Web应用中通常会包含以下的web对象: 静态文件对象:HTML页面,图片,普通文件 Servlet: ...

  3. hdu 5125 magic balls

    题意:求a数组的LIS,但是加了一个条件,为了LIS最大 b[i] a[i]可以交换.最多交换m次: 思路:我们令dp[i][j][l]表示i在最长上升子序列中,已经损失j点能量,第i个人转换了ai和 ...

  4. axd与ashx区别

    简单说明一下axd文件.axd文件实际上并不是在硬盘上存在的文件,而是HttpHandler的一种映射.在ASP.NET MVC中有很多内置的axd到ashx的映射.你可以在web.config中通过 ...

  5. Xen、KVM和VirtualBox比拼

    vbox 与 kvm 的区别: vbox 是由 qemu 改写而成,包含大量 qemu 代码.可以使用于 不支持 虚拟化的cpu.值得说的一点:vbox 在图形方面比较好,能进行2D 3D加速.cpu ...

  6. ExecuteNonQuery返回负数

    用 ExecuteNonQuery 执行sql语句"select * from table where id=@id"如果检索出符合条件的ID ExecuteNonQueue 会返 ...

  7. Exception starting filter struts2 java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor

    按教程,使用Convention插件进行配置 教程中说只要加入struts2-convention-plugin-2.3.4.1.jar这个jar包就可以使用. 按照这种方法部署后,启动tomcat报 ...

  8. [Java I/O] TextFile 工具类

    一种常见的编程任务是,从一个文件读取内容,修改内容,再把内容写到另一个文件里. Java 要实现读取.写入操作,需要创建多个类才能产生一个 Stream 进行操作. 下面是一个简单的工具类,封装对文件 ...

  9. input上传文件显示图片缩略图

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  10. oracle REGEXP_SUBSTR实现字符串转列

    如将字符串'张三,李四,王五,赵六,'转换成 1.  张三 2.李四 3.王五 4.赵六 REGEXP_SUBSTR 查询语句: WITH TEST AS (SELECT  '张三,李四,王五,赵六, ...