博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[解题报告]HDU 1096 A+B for Input-Output Practice (VIII)
阅读量:7029 次
发布时间:2019-06-28

本文共 1013 字,大约阅读时间需要 3 分钟。

A+B for Input-Output Practice (VIII)

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)

Total Submission(s): 68769    Accepted Submission(s): 21074

Problem Description
Your task is to calculate the sum of some integers.
 

 

Input
Input contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M integers follow in the same line. 
 

 

Output
For each group of input integers you should output their sum in one line, and you must note that there is a blank line between outputs.
 

 

Sample Input
3 4 1 2 3 4 5 1 2 3 4 5 3 1 2 3
 

 

Sample Output
10 15 6
 

 

Author
lcy
 
 
 
 
一直没过不是你的错,是因为
最后一个输出不用换行了。。。
 
#include
int main(){ int n; int m; scanf("%d",&m); while(m--) { scanf("%d",&n); int sum=0; while(n--) { int a; scanf("%d",&a); sum+=a; } printf("%d\n",sum); if(m) printf("\n"); } return 0;}

 

转载于:https://www.cnblogs.com/TheLaughingMan/archive/2013/03/26/2983206.html

你可能感兴趣的文章
互联网广告综述之点击率特征工程
查看>>
HDU3421 Max Sum II【序列处理】
查看>>
POJ NOI MATH-7653 地球人口承载力估计
查看>>
iOS UI高级之网络编程(HTTP协议)
查看>>
使用cocoaPods import导入时没有提示的解决办法
查看>>
iOS数据持久化存储之归档NSKeyedArchiver
查看>>
JavaScript面向对象
查看>>
Intellij修改模板代码
查看>>
2.页面布局示例笔记
查看>>
一些老游戏CPU 100%占用的解决方法
查看>>
f5基本介绍
查看>>
博前语
查看>>
Java SE核心之一:常用类,包装类,其他基本数据类型包装类。
查看>>
郑捷《机器学习算法原理与编程实践》学习笔记(第二章 中文文本分类(一))...
查看>>
python (ploit)
查看>>
Android 用achartengine 画折线图怎么显示不正确
查看>>
程序简单的测试与升级(暨实践第一次作业)
查看>>
信号处理
查看>>
【100题】第五十九题 用C++编写不能被继承的类
查看>>
轻描淡写
查看>>