武汉科技大学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 ...
随机推荐
- IPv6-only 的兼容性解决方案-b
前几天Apple宣布 6月1日后所有应用必须支持IPv6-only网络 今天抽空看了下这方面的知识 首先解释下IPv6的是什么? 维基百科的定义如下:IPv6是Internet Protocol ve ...
- Android调用Asp.net Web Service示例
WebService代码: using System; using System.Collections.Generic; using System.Linq; using System.Web; u ...
- gcc编译动态和静态链接库
我们通常把一些公用函数制作成函数库,供其它程序使用.函数库分为静态库和动态库两种.静态库在程序编译时会被连接到目标代码中,程序运行时将不再需要该静态库.动态库在程序编译时并不会被连接到目标代码中,而是 ...
- BAT带队烧钱圈地华为们猛追云计算
在和一位创业者交流时,他说现在创业者想从市场脱颖而出太难了,且不论创业本身的不易,更多时候是想做的事情都被BAT广撒网覆盖了. 现实也正是如此,包括影业.在线音乐.车联网等领域,BAT都已涉足.如今, ...
- Android 有趣味的GridView
工作这么久以来,都是以解决需求为目标.渐渐发现这种学习方式不好,学到的知识能马上解决问题,但没有经过梳理归纳.故想系统总结下一些有趣味的知识点.在这篇博客中想以一个例子系统讲解下GridView控件涉 ...
- HDOJ(HDU) 1799 循环多少次?(另类杨辉三角)
Problem Description 我们知道,在编程中,我们时常需要考虑到时间复杂度,特别是对于循环的部分.例如, 如果代码中出现 for(i=1;i<=n;i++) OP ; 那么做了n次 ...
- 将使用netTcp绑定的WCF服务寄宿到IIS7上全记录 (这文章也不错)
原文地址:http://www.cnblogs.com/wengyuli/archive/2010/11/22/wcf-tcp-host-to-iis.html 摘要 在项目开发中,我们可能会适时的选 ...
- Oracle——PL/SQL 语句
目录: 1.什么是PL/SQL 2.PL/SQL 语法基础 3.PL/SQL 实例 一.过程 实例 二.函数 实例 三.游标的使用 实例 四.动态sql 实例 五.触发器 实例 1.什么是 ...
- web端及时通讯原理
前言 有关IM(InstantMessaging)聊天应用(如:微信,QQ).消息推送技术(如:现今移动端APP标配的消息推送模块)等即时通讯应用场景下,大多数都是桌面应用程序或者native应用较为 ...
- 多态 JAVA
多态(Java) 一.多态 1.什么是多态? 不同的对象对于同一个操作,做出的响应不同 具有表现多种形态的能力的特征 2.使用多态的优点 : 为了实现统一调用 二.子类到父类的转换(向上转型) ① ...