#include<iostream>
using namespace std;
void main()
{
int b,c,sum=0;
while(scanf("%d",&b)!=EOF)
{
sum=0;
for(int i=0;i<b;i++)
{
cin>>c;
sum+=c;
}
cout<<sum<<endl;
}
}

Problem Description

Your task is to calculate the sum of some integers.
 
Input
Input contains multiple test cases, and one case one line. Each case starts with an integer N, and then N integers follow in the same line.

 
Output
For each test case you should output the sum of N integers 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
 
Sample Output
10
15
 
Author
lcy

最新文章

  1. Pyqt 国际化多语言支持
  2. C++ 11 lambda
  3. angular路由配置用法
  4. PresentViewController切换界面(一些系统自带的页面切换动画)
  5. java中汉字自动转换成拼音
  6. ubuntu下搭建cocos2dx编程环境-中
  7. Head First HTML5 Programming笔记--chapter1 认识HTML5
  8. python学习第七天
  9. The 50 Most Essential Pieces of Classical Music
  10. C++赋值运算符与赋值表达式
  11. Mesos-error
  12. 350 - Pseudo-Random Numbers
  13. Attribute的理解和认识
  14. APP金融安全白皮书十大安全注意事项及各项注意安全
  15. 学习笔记TF028:实现简单卷积网络
  16. Network POJ - 3417(LCA+dfs)
  17. linux虚拟机长时间不用时间改回来的方法
  18. 【八】虚拟机工具 01 jps命令详解
  19. freeradius 错误: error:140890C7:SSL routines:ssl3_get_client_certificate:peer did not return a certificate
  20. CS231-Multi-calss SVM的求导

热门文章

  1. 为什么要使用Docker?
  2. Egret学习笔记 (Egret打飞机-3.实现背景循环滚动)
  3. Zookeeper笔记3——原理及其安装使用
  4. c#判断外部可执行程序是否已打开(若未打开则打开)
  5. Keras学习笔记
  6. Android程序启动过程深入解析
  7. Java中替换HTML标签的方法
  8. 一种基于主板BIOS的身份认证方案及实现
  9. 8.C++-类的关键字
  10. eclipse远程调试Tomcat方法(测试成功并且说说遇到的坑)