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

  1. 3
  2. 4 1 2 3 4
  3. 5 1 2 3 4 5
  4. 3 1 2 3

Sample Output

  1. 10
  2.  
  3. 15
  4.  
  5. 6
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int N;
  7. cin >> N;
  8. while (N--)
  9. {
  10. int M,sum = ;
  11. cin >> M;
  12. while (M--)
  13. {
  14. int i;
  15. cin >> i;
  16. sum += i;
  17. }
  18. cout << sum << endl;
  19. if (N != )cout << endl;//没有此行运行时会出现错误:Presentation Error
  20. }
  21.  
  22. return ;
  23. }

武汉科技大学ACM :1008: A+B for Input-Output Practice (VIII)的更多相关文章

  1. 武汉科技大学ACM :1001: A+B for Input-Output Practice (I)

    Problem Description Your task is to Calculate a + b. Too easy?! Of course! I specially designed the ...

  2. 武汉科技大学ACM :1007: A+B for Input-Output Practice (VII)

    Problem Description Your task is to Calculate a + b. Input The input will consist of a series of pai ...

  3. 武汉科技大学ACM :1006: A+B for Input-Output Practice (VI)

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

  4. 武汉科技大学ACM :1005: A+B for Input-Output Practice (V)

    Problem Description Your task is to calculate the sum of some integers. Input Input contains an inte ...

  5. 武汉科技大学ACM :1004: A+B for Input-Output Practice (IV)

    Problem Description Your task is to Calculate the sum of some integers. Input Input contains multipl ...

  6. 武汉科技大学ACM :1003: A+B for Input-Output Practice (III)

    Problem Description Your task is to Calculate a + b. Input Input contains multiple test cases. Each ...

  7. 武汉科技大学ACM :1002: A+B for Input-Output Practice (II)

    Problem Description Your task is to Calculate a + b. Input Input contains an integer N in the first ...

  8. 武汉科技大学ACM:1006: 我是老大

    Problem Description 今年是2021年,正值武汉科技大学 ACM俱乐部成立10周年.十周年庆祝那天,从ACM俱乐部走出去的各路牛人欢聚一堂,其乐融融.庆祝晚会上,大家纷纷向俱乐部伸出 ...

  9. 武汉科技大学ACM:1005: Soapbear and Honey

    Problem Description Soapbear is the mascot of WHUACM team. Like other bears, Soapbear loves honey ve ...

  10. 武汉科技大学ACM:1008: 零起点学算法64——回型矩阵

    Problem Description 输出n*m的回型矩阵 Input 多组测试数据 每组输入2个整数 n和m(不大于20) Output 输出n*m的回型矩阵,要求左上角元素是1,(每个元素占2个 ...

随机推荐

  1. InstallShield FEQ

    Q: 如何替换setup.exe的图标? A: 这不是一个推荐的操作,因为可能会引起不可预见的错误,而且IS没有开放这个接口.如果你坚持要这么做,可以使用第三方软件比如ExeScope来进行图标替换. ...

  2. 使用Snort进行入侵检测方法

    http://blog.itpub.net/21507458/viewspace-1111587/ http://searchitchannel.techtarget.com/tip/Detect-e ...

  3. 其实,SSL也不是配通了就什么都不管的~~

    其中太多的中间人攻击需要去加强加固~~ 测试过A级是必须的!! https://www.ssllabs.com/ssltest/ 这网址两年前,我写过的哈

  4. delphi 托盘程序 转

    Delphi的托盘编程   .现在很多程序都用这个,比如傲游,迅雷等,主要代码如下: uses Windows, Messages, SysUtils, Variants, Classes, Grap ...

  5. Triangle——LeetCode

    Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent n ...

  6. 计算机语言的发展(the history of computer's language)

    第一部分 计算机语言的分类: 机器语言:直接用二进制代码指令表达的计算机语言,指令是用0和1组成的一串代码.例如:1011011000000000,表示加法.可以直接执行. 汇编语言:汇编指令集.伪指 ...

  7. Android SDK的下载和安装

    Android SDK包含的各种库文件.文档.源代码.示例代码……都是通过SDK Tools来下载和安装的,所以我们需要首先下载和安装SDK工具包(SDK Tools Package). 这一步我们可 ...

  8. 尚学堂 JAVA Day3 概念总结

    java中的运算符 1.算术运算符 + - * / % Arithmetic operators + 运算符有三种身份 Additive Operator 1)加法:如 a + b; 2)连接:如 “ ...

  9. war文件

    原文地址:http://blog.sina.com.cn/s/blog_4cbc6fdd0100fojv.html jar包和war包的区别:war是一个web模块,其中需要包括WEB-INF,是可以 ...

  10. packets

    packets   时间限制(普通/Java):1000MS/10000MS     运行内存限制:65536KByte 总提交: 27            测试通过: 14 描述 A factor ...