fork 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 java.lang.Exception
  11. {
  12. Scanner skaner = new Scanner(System.in);
  13. int liczbaTestow = skaner.nextInt();
  14.  
  15. ArrayList<String> tablica = new ArrayList<String>();
  16. for(int i=0;i<liczbaTestow;i++){
  17. int liczbaLiczb = skaner.nextInt();
  18. for(int j=0;j<=liczbaLiczb;j++){
  19. String a = skaner.nextLine();
  20. tablica.add(a);
  21. }
  22. for(int k=liczbaLiczb;k!=0;k--){
  23. String c = tablica.get(k);
  24. System.out.print(c+" ");
  25. }
  26.  
  27. }
  28. }
  29. }
Runtime error #stdin #stdout #stderr 0.15s 321344KB
stdin
2
7 1 2 3 4 5 6 7
3 3 2 11
stdout
Standard output is empty
stderr
Exception in thread "main" java.util.NoSuchElementException: No line found
	at java.util.Scanner.nextLine(Scanner.java:1540)
	at Ideone.main(Main.java:19)