A+B for Input-Output Practice (V)
Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 36633    Accepted Submission(s): 24927

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 with one line of output for each line in input.

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

Sample Output
10
15

#include <stdio.h>
int main()
{int n;
 scanf("%d",&n);
    while(n--)
 {int a,i,m,sum=0;
  scanf("%d",&m);
  for(i=0;i<m;i++)
  {
  scanf("%d",&a);
  sum+=a;
  }
 printf("%d\n",sum);
 }
 return 0;
}

最新文章

  1. 数据存储_ SQLite (1)
  2. 大公司的PHP面试题
  3. mysql:忘记root密码
  4. 用shell在一个文件后面的每一行追加数据
  5. ASP.NET MVC下使用文件上传
  6. Django的Many-to-Many(多对多)模型
  7. VS2013 打开项目时出现 未定义标识符string的解决办法
  8. StageFright框架流程解读
  9. HTML+CSS D08浮动
  10. [日志分析] Access Log 日志分析
  11. flex 圣杯布局
  12. vscode指定扩展安装位置
  13. iOS开发之获取当前展示的VC
  14. ABAP其实也是挺好的语言
  15. 文本文档中各字母出现次数汇总(java)
  16. NET的基本用法
  17. Linux安装rz/sz,htop插件
  18. zabbix3.4web界面添加第一台被监控服务器图文教程
  19. redis windows版本下载地址(不用hm提供的)
  20. python接口自动化-参数化

热门文章

  1. Android4.4 wpa_supplicant深入分析之wpa_supplicant初始化流程续
  2. C++模板(菜鸟教程)
  3. 简述RTMPDump与编译移植
  4. (Go)11.九九乘法表示例
  5. [Luogu2324]八数码难题
  6. IO流遍历文件夹下所有文件问题
  7. DB2数据常用指令
  8. 安装rails卡住很慢 出现302 Moved Temporarily
  9. dubbo之上下文信息
  10. day36 类的三大特性---封装以及Property特性