fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main(String[] args) throws NumberFormatException, IOException {
  11. int iloscZadan = Integer.parseInt(wej.readLine());
  12. StringBuilder wynik = new StringBuilder();
  13. for(;iloscZadan>0;iloscZadan--){
  14. wej.readLine();
  15. String[] s = wej.readLine().split(" ");
  16. int wyj =0;
  17. for(int i = 0;i<s.length;i++){
  18. wyj+= Integer.parseInt(s[i]);
  19. }
  20. wynik.append(wyj);
  21. wynik.append("\n");
  22. }
  23. System.out.println(wynik);
  24. }
  25. }
Success #stdin #stdout 0.06s 380224KB
stdin
2
-12
23
34
545
59656
39434
39438
stdout
23
545