fork download
  1. import java.io.*;
  2.  
  3. public class Main {
  4. public static void main(String args[]) throws IOException{
  5.  
  6. String s, a, b;
  7. s = in.readLine();
  8. int suma=0;
  9. int t = Integer.parseInt(s);
  10. if ((0 < t) && (t < 100)){
  11. for (int i=0; i<=t-1; i++){
  12. a = in.readLine();
  13. int n = Integer.parseInt(a);
  14. for (int j=0; j<=n-1; j++ ) {
  15. b = in.readLine();
  16. int g = Integer.parseInt(b);
  17. suma = suma + g;
  18. }
  19. System.out.println(suma);
  20. suma = 0;
  21. }
  22. }
  23. }
  24. }
Success #stdin #stdout 0.04s 4386816KB
stdin
2
5
1
2
3
4
5
2
-100
100
stdout
15
0