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 <iostream>
using namespace std; int main()
{
int T;
cin >> T ;
while(T--)
{
int N,sum = ;
cin >> N;
while (N--)
{
int i;
cin >> i;
sum += i;
}
cout << sum << endl;
} return ;
}

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

  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 :1008: A+B for Input-Output Practice (VIII)

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

  3. 武汉科技大学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 ...

  4. 武汉科技大学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 ...

  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:1005: 单位转换

    Problem Description BobLee最近在复习考研,在复习计算 机组成原理的时候,遇到了一个问题.就是在计算机存储里面的单位转换.我们都知道1MB=1024KB,1KB=1024B,1 ...

随机推荐

  1. linux ftp 搭建和相关问题解决

    1. 查看是否安装vsftprpm –qa|grep vsftpd如果出现 vsftpd-2.0.5-16.el5_5.1 说明已经安装 vsftp 安装vsftpyum -y install vsf ...

  2. 使用Java Applet在客户端解压缩,以及使用证书的意义

    以前解压缩是用Java Applet在客户端解压缩,而且用户不知道这回事.但是现在Chrome不支持NP API了,所以不得不把Java去掉,然后在服务器里解压缩.风险在于,解压缩以后,传输到客户端的 ...

  3. 开启和关闭wifi的代码段

    1.需要申请的权限android.permission.ACCESS_WIFI_STATE android.permission.CHANGE_WIFI_STATE android.permissio ...

  4. Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0

    如果遇到这个问题,首先考虑以下原因: 你是否在setText()方法中设置了一个int型变量,比如setText(10). 这样Android系统就会主动去资源文件当中寻找, 但是它不是一个资源文件I ...

  5. 【HDOJ】2809 God of War

    状态DP. /* 2809 */ #include <iostream> #include <queue> #include <cstdio> #include & ...

  6. dnat,snat

    Iptables实现NAT是最基本的功能,大部分家用路由都是基于其SNAT方式上网,使用Iptables实现外网DNAT也很简单,不过经常会出现不能正常NAT的现象. 以下命令将客户端访问1.,很多人 ...

  7. SPFA 最短路径打印方法

    #include <iostream> #include <cstdlib> #include <cstdio> #include <algorithm> ...

  8. 【5】JAVA---地址App小软件(DeletePanel.class)(表现层)

    删除地址的表现层类. 如果没有选中要删除的地址信息,会出现窗口提示: 删除地址界面:(无法修改数据,只能看) /* * DeletePanel.java * */ package cn.hncu.ad ...

  9. [ 转]国内有时抽风,无法更新adt的解决方案

    http://www.xidige.com/other/354 最近无意中发现mirrors.neusoft.edu.cn有android的目录,进去还能看到xml文件,所以网络搜索了一下,发现还有另 ...

  10. 使用libevent进行多线程socket编程demo

    最近要对一个用libevent写的C/C++项目进行修改,要改成多线程的,故做了一些学习和研究. libevent是一个用C语言写的开源的一个库.它对socket编程里的epoll/select等功能 ...