Power Mouth

Time Limit: 2000/1000ms (Java/Others)

Problem Description:

Your task is to calculate the sum of some integers.

Input:

The input contains several cases,each case contains an integer N in the first line, and then N lines follow(as a group). 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:

It is easy.

Sample Output:

It is simple.
解题思路:题目很简单,输出之间要有一空行,累加m个数并输出即可。
AC代码:
 #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
LL sum,n,m,x;bool flag;
int main(){
while(cin>>n){
flag=false;
while(n--){
cin>>m;sum=;
if(flag)cout<<endl;//输出之间留一空行,第一次不输出,以后每次都输出空行
while(m--){cin>>x;sum+=x;}
cout<<sum<<endl;
flag=true;
}
}
return ;
}

最新文章

  1. git常用操作命令
  2. 利用日期、经纬度求日出日落时间 C语言程序代码(zz)
  3. MathML + MathJax在网页中插入公式
  4. 将一个query后面的参数转为数组
  5. 如何处理PHP和MYSQL的并发以及优化
  6. 脱离rails 使用Active Record
  7. poj 1325 Machine Schedule 二分匹配,可以用最大流来做
  8. 【C#】用C#通过读取数据库方式读取CSV文件
  9. 【开源java游戏框架libgdx专题】-12-开发工具-图片合成
  10. Swift语言iOS开发:CALayer十则示例
  11. rzsz不能大于4G,securefx传5.2G没有问题,
  12. linux下使用vi操作
  13. C# dll 事件执行 js 回调函数
  14. IntelliJ IDEA创建多模块依赖项目
  15. Fiddler--Filters
  16. 补充资料——自己实现极大似然估计(最大似然估计)MLE
  17. ZJOI2019Day1AFO记
  18. 牛客国庆集训派对Day4.B.异或求和(按位统计)
  19. 深入C#的String类
  20. 通过SQL直接插入、修改ArcGIS SDE空间表中的数据

热门文章

  1. 1.ARM嵌入式体系结构与接口技术(Cortex-A8版)
  2. 洛谷 2213 [USACO14MAR]懒惰的牛The Lazy Cow_Sliver
  3. 离职 mark
  4. [luoguP1156] 垃圾陷阱(DP)
  5. 校长的收藏(洛谷 U4534)
  6. 做ssh框架整合的时候,遇到如下错误:AnnotationTransactionAttributeSource is only available on Java 1.5 and higher
  7. [bzoj3668][Noi2014]起床困难综合症_暴力
  8. Node.js和Chrome V8 引擎了解
  9. sql-server-storage-internals
  10. xcode执行后没看到输出的解决的方法