武汉科技大学ACM :1004: A+B for Input-Output Practice (IV)
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)的更多相关文章
- 武汉科技大学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 ...
 - 武汉科技大学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 ...
 - 武汉科技大学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 ...
 - 武汉科技大学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 ...
 - 武汉科技大学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 ...
 - 武汉科技大学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 ...
 - 武汉科技大学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 ...
 - 武汉科技大学ACM:1006: 我是老大
		
Problem Description 今年是2021年,正值武汉科技大学 ACM俱乐部成立10周年.十周年庆祝那天,从ACM俱乐部走出去的各路牛人欢聚一堂,其乐融融.庆祝晚会上,大家纷纷向俱乐部伸出 ...
 - 武汉科技大学ACM:1005: Soapbear and Honey
		
Problem Description Soapbear is the mascot of WHUACM team. Like other bears, Soapbear loves honey ve ...
 - 武汉科技大学ACM:1004: Lake and Island
		
Problem Description 北园孩子的专属福利来啦~学校从北区宿舍到湖心岛修建了一条通道让北园的同学们可以上去一(kuang)同(xiu)玩(en)耍(ai),这一天,IcY向ahm001 ...
 
随机推荐
- 关于 从别人电脑上  高版本的 Xcode上拷贝过来的项目的  不能运行模拟器的 解决方法
			
如图 从别人电脑上 拷贝过来的 工程 打开后 点击 iOS Device 只有 一个选项 没有模拟器.这说明 自己的 Xcode 的版本比 创建这个工程所用的版本低.所以 要睇啊你tar ...
 - 畅谈Spring设计哲学
			
自己从学习编程开始到现在有一个习惯:一直喜欢把软件开发中的技术和思路放到实际生活中去类比考虑.自己平常也喜欢开一些关于软件哲学的书籍,事实证明这些书籍对自己的学习新技术很有很大的帮助.数学是一切学科的 ...
 - MFC枚举USB设备碰到的一个疑难,还没解决
			
代码如下: 打开USB Hub设备之后,返回句柄hHubDevice,然后使用EnumerateHubPorts来枚举Hub的端 口.疑问在代码的中文注释中. bool CUsbEnumHub::En ...
 - Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)
			
Node应用,使用formidable处理文件上传,本地测试没有问题,部署到服务器上之后上传大文件浏览器收到以下错误信息: Failed to load resource: the server re ...
 - Chrome extension
			
PageSpeed Tincr SpriteMe JSONView FireMobileSimulator for Google Chrome™
 - POJ1573 Robot Motion(模拟)
			
题目链接. 分析: 很简单的一道题, #include <iostream> #include <cstring> #include <cstdio> #inclu ...
 - OI记忆口诀
			
splay_rotate: inline void rotate(splay_node *x){ splay_node *y,*z;int d1,d2; d1=get_parent(x,y);//三个 ...
 - c++ map 插入数据后,begin(),end()以及当前迭代器的变化
			
1. map.end()指向map的最后一个元素之后的地址,无论执行map.erase(iter)还是map.add(key, value),map.end()所返回的值永远不会发生变化,都是指向同一 ...
 - SQL Server优化之SQL语句优化
			
一切都是为了性能,一切都是为了业务 一.查询的逻辑执行顺序 (1) FROM left_table (3) join_type JOIN right_table (2) ON join_conditi ...
 - 重写扫雷(基于jQuery) 新手 有不足的地方敬请谅解
			
记得刚开始学习js的时候写过一次扫雷,一个下午的时间被计算搞死,整个头是晕乎. 入职后,蹭着空闲的时间随手写了一个扫雷. 直接上代码了 (function() { function module() ...