fork download
  1. static byte[] input = new byte[1024];
  2. static int size, position;
  3.  
  4. public static byte nextByte() throws Exception {
  5. if (position == size) {
  6. size = System.in.read(input);
  7. position = 0;
  8. }
  9.  
  10. return input[position++];
  11.  
  12. }
  13.  
  14. public static int nextInt() throws Exception {
  15. byte b = nextByte();
  16. int n = 0;
  17.  
  18. while (!(b >= '0' && b <= '9')) {
  19. b = nextByte();
  20.  
  21. }
  22. while ((b >= '0' && b <= '9')) {
  23. n = n * 10 + b - '0';
  24. b = nextByte();
  25.  
  26. }
  27.  
  28. return n;
  29.  
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
	static byte[] input = new byte[1024];
	       ^
Main.java:2: error: class, interface, or enum expected
	static int size, position;
	       ^
Main.java:4: error: class, interface, or enum expected
	public static byte nextByte() throws Exception {
	              ^
Main.java:7: error: class, interface, or enum expected
			position = 0;
			^
Main.java:8: error: class, interface, or enum expected
		}
		^
Main.java:12: error: class, interface, or enum expected
	}
	^
Main.java:14: error: class, interface, or enum expected
	public static int nextInt() throws Exception {
	              ^
Main.java:16: error: class, interface, or enum expected
		int n = 0;
		^
Main.java:18: error: class, interface, or enum expected
		while (!(b >= '0' && b <= '9')) {
		^
Main.java:21: error: class, interface, or enum expected
		}
		^
Main.java:24: error: class, interface, or enum expected
			b = nextByte();
			^
Main.java:26: error: class, interface, or enum expected
		}
		^
Main.java:30: error: class, interface, or enum expected
	}
	^
13 errors
stdout
Standard output is empty