武汉科技大学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 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
3
4 1 2 3 4
5 1 2 3 4 5
3 1 2 3
Sample Output
10 15 6
#include <iostream>
using namespace std; int main()
{
int N;
cin >> N;
while (N--)
{
int M,sum = ;
cin >> M;
while (M--)
{
int i;
cin >> i;
sum += i;
}
cout << sum << endl;
if (N != )cout << endl;//没有此行运行时会出现错误:Presentation Error
} return ;
}
武汉科技大学ACM :1008: A+B for Input-Output Practice (VIII)的更多相关文章
- 武汉科技大学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 :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 :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 ...
- 武汉科技大学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:1008: 零起点学算法64——回型矩阵
Problem Description 输出n*m的回型矩阵 Input 多组测试数据 每组输入2个整数 n和m(不大于20) Output 输出n*m的回型矩阵,要求左上角元素是1,(每个元素占2个 ...
随机推荐
- Android Studio 模拟器 不要皮肤,效果更好
新建或者编辑虚拟机时,皮肤选择"No Skin"即可,第二张图片就是无皮肤的效果,看着更爽啊.
- 转:MongoDB调查总结
与关系型数据库相比,MongoDB的优点:①弱一致性(最终一致),更能保证用户的访问速度:举例来说,在传统的关系型数据库中,一个COUNT类型的操作会锁定数据集,这样可以保证得到“当前”情况下的精确值 ...
- Qt Quick分组属性案例
import QtQuick 2.4 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Win ...
- poj 3026Borg Maze
http://poj.org/problem?id=3026 #include<cstdio> #include<iostream> #include<cstring&g ...
- QWidget中嵌入win32 window(使用QWindow和QWidget::createWindowContainer)
主要用到QWindow::fromWinId和QWidget::createWindowContainer这两个函数 QWindow::fromWinId用来创建一个win32窗口的代理 QWidge ...
- 软件发布版本区别介绍-Alpha,Beta,RC,Release
Alpha: Alpha是内部测试版,一般不向外部发布,会有很多Bug.除非你也是测试人员,否则不建议使用. 是希腊字母的第一位,表示最初级的版本 alpha就是α,beta就是β alpha版就是比 ...
- Android之路-------浅淡Android历史、系统架构与开发特色
前言 离上一篇发表的博客差不多有两个星期了吧,相信有些博友差点就对LP失望了,因为上一篇博文中说了,这次不管怎样,LP都会坚持写博客的. 由于工作关系LP才隔了这么久才再次发表博文,这篇博文主要是总结 ...
- LinGo:投资问题——线性规划
一.根据题目所给数据,建立一张表格方便查看 项目A 项目B 项目C 项目D 可投资年 1,2,3,4 3 2 1,2,3,4,5 收回本利年 次年年末 第5年 第5年 当年年末 本利 1.06 1.1 ...
- Event — Windows API
Event即事件是一种用于进行线程/进程间同步的对象,事件有置位和复位两种状态,当线程通过waiting functions等待Event对象置位时该线程将进入阻塞状态,当该Event对象被置位或等待 ...
- javascript对链接进行动态处理化
// $(function(){// var aLink=$('.nav-content .nav li a'); // 选中所有a// var aText=['在线搭配','星网学院','推客联盟' ...