HDOJ 1096 A+B for Input-Output Practice (VIII)

来源:互联网 发布:mac品牌竞争对手 编辑:程序博客网 时间:2024/06/05 23:49
/** * A+B for Input-Output Practice (VIII) * 和Problem1000是同一个题目,注意题目的输入输出格式. * 输出结果之间要有blank line,末尾不能有blank line. * Created by YangYuan on 2017/12/7. */public class Problem1096{    public static void main(String[] args)    {        Scanner scanner = new Scanner(System.in);        int n = scanner.nextInt();        for (int i = 0; i < n; i++)        {            int m = scanner.nextInt();            int sum = 0;            for (int j = 0; j < m; j++)                sum += scanner.nextInt();            System.out.println(sum);            if (i != n - 1)                System.out.println();        }    }}
阅读全文
0 0
原创粉丝点击