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. import java.util.Scanner;
  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 scan_napis = new Scanner(System.in);
  13. String napis;
  14. String wynik;
  15. int a;
  16.  
  17. //Pobieranie wartości czyli ilości pobieranych napisów
  18. String str_a = scan_napis.nextLine();
  19. a = Integer.parseInt(str_a);
  20.  
  21. for(int i =0;i<a;i++){
  22. //Pobieranie napisu
  23. napis = scan_napis.nextLine();
  24.  
  25. wynik = napis.substring(0, napis.length()/2);
  26. System.out.println(wynik);
  27. }
  28. }
  29. }
Runtime error #stdin #stdout #stderr 0.05s 711680KB
stdin
Standard input is empty
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:18)