A+B for Input-Output Practice (VIII)

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)

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

import java.util.Scanner;
public class Main { public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
while(T-->0){
int n=sc.nextInt();
int sum=0;
for(int i=0;i<n;i++)
sum+=sc.nextInt();
System.out.println(sum);
if(T!=0)System.out.println(); //最后一行不空一行
}
sc.close(); } }

A+B for Input-Output Practice (VIII)的更多相关文章

  1. hdu 1096 A+B for Input-Output Practice (VIII)

    A+B for Input-Output Practice (VIII) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/3 ...

  2. hdoj_Problem1.1.8_A+B for Input-Output Practice (VIII)

    A+B for Input-Output Practice (VIII) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/3276 ...

  3. PHP-FPM-failed to ptrace(PEEKDATA) pid 123: Input/output error

    If you're running PHP-FPM you can see these kind of errors in your PHP-FPM logs. $ tail -f php-fpm.l ...

  4. NFS挂载异常 mount.nfs: Input/output error

    [root@localhost ~]# vi /etc/exports #增加/nfs 192.168.10.132(rw,no_root_squash,no_all_squash,async) [r ...

  5. BIOS(Basic Input/Output System)是基本输入输出系统的简称

    BIOS(Basic Input/Output System)是基本输入输出系统的简称 介绍 操作系统老师说,平时面试学生或者毕业答辩的时候他都会问这个问题,可见这个问题对于计算机专业的学生来说是如此 ...

  6. read()、write()返回 Input/output error, Device or resource busy解决

    遇到的问题,通过I2C总线读.写(read.write)fs8816加密芯片,报错如下: read str failed,error= Input/output error! write str fa ...

  7. Angular 个人深究(三)【由Input&Output引起的】

    Angular 个人深究(三)[由Input&Output引起的] 注:最近项目在做别的事情,angular学习停滞了 1.Angular 中 @Input与@Output的使用 //test ...

  8. Docker 在转发端口时的这个错误Error starting userland proxy: mkdir /port/tcp:0.0.0.0:3306:tcp:172.17.0.2:3306: input/output error.

    from:https://www.v2ex.com/amp/t/463719 系统环境是 Windows 10 Pro,Docker 版本 18.03.1-ce,电脑开机之后第一次运行 docker ...

  9. dpdk EAL: Error reading from file descriptor 23: Input/output error

    执行test程序时输出: EAL: Error reading from file descriptor 23: Input/output error 原因: 在虚拟机添加的网卡,dpdk不支持导致的 ...

随机推荐

  1. MongoDB(课时21 索引)

    3.5 索引(重点) 任何数据库中,索引都是一种提升数据库检索性能的手段,这一点在MongoDB数据库中同样是存在的,MongoDB数据库里面存在两种索引创建:一是自动创建,另外是手工创建. 范例:重 ...

  2. 解决RDP连接不上

    1,开始->运行 regedit 删除注册表项目:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft, 删除MSLicensing.2,开始--运行 mstsc /v:( ...

  3. 899F - Letters Removing

    Codeforces 899F - Letters Removing 思路:考虑一下怎么找到输入的l和r在原来串中的位置,我们想到用前缀和来找,一开始所有位置都为1,删掉后为0,那么前缀和为l的位置就 ...

  4. Java 包的概述和讲解

    2017-11-02 22:58:45 包(package):其实就是文件夹. 包的作用是对类进行分类的管理,并且区分不同的类名. 举例: 学生:增加,删除,修改,查询 教师:增加,删除,修改,查询 ...

  5. mount ntfs-3g , fstab里的配置没有效果

    把ntfs-3g配置在 fstab 里,mount 时会报 No such device 网上也有在嵌入式系统里发生的类似例子. 没有解决方法,也不准备再研究了. 准备在机器启动之后,手动下面的命令 ...

  6. php程序突然不能用file_get_contents()访问远程网址了?

    php程序用file_get_contents("http://www.***.com"),一直以来好好的,突然间就不能链接远程网址了,在shell下可以ping通远程网址,可是用 ...

  7. android--------Retrofit+RxJava的使用

    Retrofit是Square公司开发的一款针对Android网络请求的一个当前很流行的网络请求库. http://square.github.io/retrofit/ https://github. ...

  8. Strip CodeForces - 487B (单调队列)

    题面: Alexandra has a paper strip with n numbers on it. Let's call them ai from left to right. Now Ale ...

  9. 数据库SQL优化(百万级数据库优化方案)

    1. 对查询进行优化 要尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2. where 子句 要尽量避免在 where 子句中对字段进行 null 值判断.( ...

  10. OAF SubTabLayoutBean隐藏子控件

    SubLayout隐藏子控件有两种方法 OASubTabLayoutBean layBean = (OASubTabLayoutBean) webBean.findIndexedChildRecurs ...