fork download
  1. import java.util.Scanner;
  2. import java.io.*;
  3. public class Main {
  4.  
  5. public static void main(String[] args) throws NumberFormatException, IOException {
  6. int iloscZadan = Integer.parseInt(wej.readLine());
  7. StringBuilder wynik = new StringBuilder();
  8. for(;iloscZadan>0;iloscZadan--){
  9. wej.readLine();
  10. String[] s = wej.readLine().split(" ");
  11. int wyj =0;
  12. for(int i = 0;i<s.length;i++){
  13. wyj+= Integer.parseInt(s[i]);
  14. }
  15. wynik.append(wyj);
  16. wynik.append("\n");
  17. }
  18. System.out.println(wynik);
  19. }
  20.  
  21. }
Runtime error #stdin #stdout #stderr 0.07s 380224KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.lang.NumberFormatException: null
	at java.lang.Integer.parseInt(Integer.java:454)
	at java.lang.Integer.parseInt(Integer.java:527)
	at Main.main(Main.java:7)