武汉科技大学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 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)的更多相关文章
- 武汉科技大学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 ...
- 武汉科技大学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 ...
- 武汉科技大学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 ...
- 武汉科技大学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 ...
- 武汉科技大学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 ...
- 武汉科技大学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 ...
- 武汉科技大学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 ...
- 武汉科技大学ACM:1006: 我是老大
Problem Description 今年是2021年,正值武汉科技大学 ACM俱乐部成立10周年.十周年庆祝那天,从ACM俱乐部走出去的各路牛人欢聚一堂,其乐融融.庆祝晚会上,大家纷纷向俱乐部伸出 ...
- 武汉科技大学ACM:1005: Soapbear and Honey
Problem Description Soapbear is the mascot of WHUACM team. Like other bears, Soapbear loves honey ve ...
- 武汉科技大学ACM:1005: 单位转换
Problem Description BobLee最近在复习考研,在复习计算 机组成原理的时候,遇到了一个问题.就是在计算机存储里面的单位转换.我们都知道1MB=1024KB,1KB=1024B,1 ...
随机推荐
- Lambert
Dmap -- 贴图信息 LightColor -- 灯光颜色 KL -- 灯光强度值(开放给美术) EnvColor -- 环境颜色 ka -- 环境光强度 (开放给美术) Dmap * (max ...
- Javascript闭包与作用域
摘自开源中国 闭包和作用域是js中比较重要的知识,自己理解起来也有一定的难度 1.Javascript的作用域是函数作用域而非块级作用域 ? 1 2 3 4 5 6 7 8 9 10 11 12 // ...
- 转:eclipse载入extjs4出现内存溢出错误的解决方法
去掉.project文件中的以下部分:第一部分:<buildCommand> <name>org.eclipse.wst.jsdt.core.javascriptVali ...
- c语言用封装来优化程序
一.基础研究 先对函数fa进行研究,代码如下: fa函数的参数为一个字符指针,他存储要输出的字符串.因为要显示在屏幕的中央位置,所以我们要把字符串放在段地址b800处.用strlen获取字符串的长度, ...
- DC-DC芯片 同步和異步方式有什么區別
同步方式是集成了High side和Low side MOSFET,組成同步整流模式,可實現高效率,價格相對貴.異步方式只有High side MOSFET;配合外部使用傳統的續流二極管,組成非同步整 ...
- MySQL全连接(Full Join)实现,union和union all用法
MySQL本身不支持你所说的full join(全连接),但可以通过union来实现 ,下面是一个简单测试,可以看看: mysql> CREATE TABLE a(id int,name cha ...
- POJSorting It All Out (拓扑)
题目链接. 题目大意: 给定一定的数量的小于关系: 1.如果发现环,输出从前几次就可以确定出现环 2.如果能够确定唯一序列,输出. 3.如果通过全部关系,还不能确定序列,则输出不能确定. 分析: 个人 ...
- -_-#微信内置JavaScript API WeixinJSBridge
微信相关的 js 操作:分享.网络.菜单 微信内置JsAPI之WeixinJSBridge微信WeixinJSBridge API续
- HBase HTablePool
Instead of creating an HTable instance for every request from your client application, it makes much ...
- MFC对话框应用程序添加自定义消息
1. 定义自定义消息 /** * \brief 消息测试 */ #define E6100_MSG_TEST ( WM_USER + 1001 ) 2. 声明自定义消息处理函数 /* ...