解题思路:
注意事项:
参考代码:
import java.util.*;
public class bajiu {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
for (int j = 0; j < x; j++) {
int sum = 0;
int n = sc.nextInt();
for (int i = 1; i <= n; i++) {
int a = sc.nextInt();
sum = sum + a;
}
System.out.println(sum);
}
}
}
0.0分
0 人评分