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();
}
}
}