新手入门--输入格式六
来源:互联网 发布:团购软件 编辑:程序博客网 时间:2024/04/20 12:33
新手入门
输入格式六:
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
代码:
#include<stdio.h>int main(){ int n,a,i,sum; while(scanf("%d",&n)!=EOF){ sum=0; for(i=0;i<n;i++){ scanf("%d",&a); sum+=a; } printf("%d\n",sum); } return 0;}
0 0
- 新手入门--输入格式六
- 新手入门--输入格式二
- 新手入门--输入格式三
- 新手入门--输入格式四
- 新手入门--输入格式五
- 新手入门——输入格式一
- python新手入门(六)
- 新手入门--输出格式七
- 新手入门--输出格式八
- jQuery新手入门(六) AJAX快餐
- ffmpeg分析系列之六(再次探测输入的格式)
- ffmpeg分析系列之六(再次探测输入的格式)
- ffmpeg分析系列之六(再次探测输入的格式)
- ffmpeg分析系列之六(再次探测输入的格式)
- 新手入门:学好Oracle的六条总结
- MC新手入门(六)------动画设置
- 【适合新手入门】批处理简单的输入判断
- 秀外慧中的springMVC(六)---输入和输出使用xml格式方式
- MongoDB:mongodb在spring项目中的配置
- 理工大学ACM平台题答案关于C语言 1166 打印直角三角形
- c++中虚函数和纯虚函数的区别
- JS不间断向上滚动
- Find命令总汇
- 新手入门--输入格式六
- pragma pack
- c++接口定义及实现举例
- #pragma pack(n)对齐用法详解(转)
- 理工大学ACM平台题答案关于C语言 1279 输出入门
- The diff between Awake,Start And OnEnable
- 细说 #pragma pack(n)
- 新手入门--输出格式七
- SQL&NoSQL年代记