HDU1094
来源:互联网 发布:linux getopt 编辑:程序博客网 时间:2024/06/06 21:04
A+B for Input-Output Practice (VI)
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 45 1 2 3 4 5
Sample Output
1015//HDU1094 基础题//A+B for Input-Output Practice (VI) http://acm.hdu.edu.cn/showproblem.php?pid=1094//2017.06.23 by wyj#include#include using namespace std;int main(){int n, a, sum;while (scanf("%d", &n) != EOF){sum = 0;while (n--){scanf("%d", &a);sum += a;}printf("%d\n", sum);}return 0;}
阅读全文
0 0
- HDU1094
- HDU1094
- hdu1094 A+B for Input-Output Practice (VI)(java)
- hdu1094 - A+B for Input-Output Practice (VI)
- HDU1094 A+B for Input-Output Practice (VI)
- 解决8080端口占用问题
- VS学习笔记一
- 小数取整 四舍五入
- HDU-6206 计算几何+大数
- 润乾v5行式填报 数据校验---小计校验
- HDU1094
- PopupWindow
- bzoj 3111: [Zjoi2013]蚂蚁寻路
- 678. Valid Parenthesis String
- GDB 7.0 中文手册 —— 2. 进入和退出GDB
- makefile和shell脚本
- springmvc基础一
- 使用七牛的sdk上传报错:incorrect region
- 【js初学】whlie语句