fork download
  1. import java.util.Scanner;
  2.  
  3. public class Main
  4. {
  5. public static void main (String[] args)
  6. {
  7. int s = 0;
  8. Scanner in = new Scanner(System.in);
  9.  
  10. while (in.hasNextDouble())
  11. {
  12. double x = in.nextDouble();
  13. s += 1;
  14. }
  15. System.out.println(s);
  16. }
  17. }
Runtime error #stdin #stdout #stderr 0.08s 4386816KB
stdin
1 25 38 abc
stdout
Standard output is empty
stderr
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextDouble(Scanner.java:2413)
	at Main.main(Main.java:12)