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. PHP之路——Mysql多表查询

    select a.id,a.`name` AS '姓名',b.`subject`,c.`achievement` from aaa AS a left join ccc AS c on a.id=c. ...

  2. noi 3531 判断整除

    3531:判断整除 查看 提交 统计 提问 总时间限制:  1000ms 内存限制:  65536kB 描述 一个给定的正整数序列,在每个数之前都插入+号或-号后计算它们的和.比如序列:1.2.4共有 ...

  3. Chapter 2. OpenSSL的安装和配置学习笔记

    Chapter 2. OpenSSL的安装和配置学习笔记 2.1 在linux上面安装OpenSSL我还是做点No paper事情比较在行,正好和老师的课程接轨一下.以前尝试过在Windows上面安装 ...

  4. 7.1 Backup and Recovery Types 备份和恢复类型

    7.1 Backup and Recovery Types 备份和恢复类型 这个章节描述 不同备份类型的特点: 物理(raw)与逻辑备份 物理备份有raw 副本组成,存储数据库内容,这种类型的备份是适 ...

  5. 建议别买三星Gear:半电脑产品 设计糟糕

    不久之前,三星刚刚发布了智能腕表Galaxy Gear,据<纽约时报>周三报道,尽管三星电子的智能手表Galax Gear集各种酷炫新功能于一身,但对消费者来说,却是个差劲的选择. < ...

  6. 一个在字符串中查找多个关键字的函数strstrs(三种不同算法实现及效率分析)

    平时项目中有时需要用到在字符串中搜索两个或更多的关键字的情景.例如:将字符串"ab|cd#ef|"按竖线或者井号做分隔 如果是大项目,一般会采用正则表达式做处理.但有时写个小程序, ...

  7. [转]百度地图点聚合MarkerClusterer移动地图时,Marker的Label丢失的问题

    参考文献:http://www.cnblogs.com/jicheng1014/p/3143859.html 问题现象: 使用MarkerClusterer_min.js,可以实现点聚合,但是当将带有 ...

  8. Spring 3 来创建 RESTful Web Services

    Spring 3 创建 RESTful Web Services 在 Java™ 中,您可以使用以下几种方法来创建 RESTful Web Service:使用 JSR 311(311)及其参考实现 ...

  9. SKNode类

    继承自 UIResponder:NSObject 符合 NSCodingNSCopyingNSObject(NSObject) 框架  /System/Library/Frameworks/Sprit ...

  10. UVa 11063 - B2-Sequence

    题目:给你一组数据{ b1,b2....,bk }中,推断是否随意两个数字的和都不同. 分析:数论.计算出全部结果,排序推断相邻结果是否同样就可以. 说明:注意数据的合法性检查. #include & ...