HDU 1.1.8

来源:互联网 发布:手机淘宝秒杀在哪 编辑:程序博客网 时间:2024/06/08 12:37

http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=1§ionid=1&problemid=3008


import java.util.Scanner;public class Main {public static void main(String[] args) {int N,n,s;Scanner in = new Scanner(System.in);N = in.nextInt();while(N-- >0) {s=0;n = in.nextInt();while (n-- > 0) {s+= in.nextInt();}System.out.println(s);if(N>0)System.out.println();}}}


0 0