#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

A+B for Input-Output Practice (VI)的更多相关文章

  1. hdu 1094 A+B for Input-Output Practice (VI)

    A+B for Input-Output Practice (VI) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/327 ...

  2. NFS挂载异常 mount.nfs: Input/output error

    [root@localhost ~]# vi /etc/exports #增加/nfs 192.168.10.132(rw,no_root_squash,no_all_squash,async) [r ...

  3. PHP-FPM-failed to ptrace(PEEKDATA) pid 123: Input/output error

    If you're running PHP-FPM you can see these kind of errors in your PHP-FPM logs. $ tail -f php-fpm.l ...

  4. BIOS(Basic Input/Output System)是基本输入输出系统的简称

    BIOS(Basic Input/Output System)是基本输入输出系统的简称 介绍 操作系统老师说,平时面试学生或者毕业答辩的时候他都会问这个问题,可见这个问题对于计算机专业的学生来说是如此 ...

  5. read()、write()返回 Input/output error, Device or resource busy解决

    遇到的问题,通过I2C总线读.写(read.write)fs8816加密芯片,报错如下: read str failed,error= Input/output error! write str fa ...

  6. Angular 个人深究(三)【由Input&Output引起的】

    Angular 个人深究(三)[由Input&Output引起的] 注:最近项目在做别的事情,angular学习停滞了 1.Angular 中 @Input与@Output的使用 //test ...

  7. Docker 在转发端口时的这个错误Error starting userland proxy: mkdir /port/tcp:0.0.0.0:3306:tcp:172.17.0.2:3306: input/output error.

    from:https://www.v2ex.com/amp/t/463719 系统环境是 Windows 10 Pro,Docker 版本 18.03.1-ce,电脑开机之后第一次运行 docker ...

  8. dpdk EAL: Error reading from file descriptor 23: Input/output error

    执行test程序时输出: EAL: Error reading from file descriptor 23: Input/output error 原因: 在虚拟机添加的网卡,dpdk不支持导致的 ...

  9. html5 填表 表单 input output 与表单验证

    1.<output>     Js计算结果 <form oninput="res.value = num1.valueAsNumber*num2.valueAsNumber ...

  10. mount_cd9660:/dev/acd0: Input/output error

    mount -t cd9660 /dev/acd0 /cdrom g_vfs_done():acd0[READ(offset32768, length=204]error =5 mount_cd966 ...

随机推荐

  1. 编写一个js函数,该函数有一个n(数字类型),其返回值是一个数组,该数组内是n个随机且不重复的整数,且整数取值范围是[2,32]

    首先定义个fn用来返回整数的取值范围: function getRand(a,b){ var rand = Math.ceil(Math.random()*(b-a)+a); return rand; ...

  2. css渲染(二) 文本

    一.文本样式  首行缩进 text-indent 首行缩进是将段落的第一行缩进,这是常用的文本格式化效果.一般地,中文写作时开头空两格.[注意]该属性可以为负值:应用于: 块级元素(包括block和i ...

  3. 概括一下nodejs

    Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境. Node.js是事件驱动,非阻塞I/O的.所以它再处理高并发,I/O密集的场景下性能优势明显,如web. 对比 ...

  4. 《清华梦的粉碎》by王垠

     清华梦的诞生 小时候,妈妈给我一个梦.她指着一个大哥哥的照片对我说,这是爸爸的学生,他考上了清华大学,他是我们中学的骄傲.长大后,你也要进入清华大学读书,为我们家争光.我不知道清华是什么样子,但是我 ...

  5. mongodb Decimal Spring data mongodb Decimal128 SpringMvc 序列化字符串 json converter

    Mongodb 3.4 就开始支持Decimal 类型,解决double的精度问题,但是不太好用,MapReduce的时候Array.sum 也不能计算 Decimal.比较坑,但是聚合可以用 Spr ...

  6. keepalived双机热备nginx

    nginx目前是我最常用的反向代理服务,线上环境为了能更好的应对突发情况,一般会使用keepalived双机热备nginx或者使用docker跑nginx集群,keepalived是比较传统的方式,虽 ...

  7. 网络基础Cisco路由交换二

    三层交换技术 作用: 使用三层交换技术实现VLAN间通信. 三层交换=二层交换+三层转发 基于CEF的快速转发 主要包含两个转发用的信息表: 转发信息库(FIB):FIB类似于路由表,包含路由表中转发 ...

  8. CSRF与xss的区别

    CSRF:无法获取受害者的cookie,无法看到cookie:               只是利用受害者是被服务器信任的(靠验证cookie),而给服务器发送请求: xss:利用cookie只是xs ...

  9. R︱foreach+doParallel并行+联用迭代器优化内存+并行机器学习算法

    要学的东西太多,无笔记不能学~~ 欢迎关注公众号,一起分享学习笔记,记录每一颗"贝壳"~ --------------------------- 接着之前写的并行算法paralle ...

  10. Shell脚本编程学习入门 01

    从程序员的角度来看, Shell本身是一种用C语言编写的程序,从用户的角度来看,Shell是用户与Linux操作系统沟通的桥梁.用户既可以输入命令执行,又可以利用 Shell脚本编程,完成更加复杂的操 ...