fork download
  1. public class Main
  2. {
  3. public static void main(String args[])throws Exception
  4. {
  5. int in,i,x=0;
  6. double y=0.0,div;
  7. byte input[]=new byte[8192];
  8. while( (in=System.in.read(input,0,input.length))>-1 )
  9. {
  10. i=0;
  11. while( input[i]!=32 )
  12. {
  13. x=x*10+input[i]-48;
  14. i++;
  15. }
  16. i++;
  17. while( input[i]!='.' )
  18. {
  19. y=y*10+input[i]-48;
  20. i++;
  21. }
  22. i++;
  23. div=1.0;
  24. while( input[i]!='\n' )
  25. {
  26. div*=10;
  27. y=y+(input[i]-48)/div;
  28. i++;
  29. }
  30. break;
  31. }
  32. if( x%5!=0 )
  33. System.out.println(y);
  34. else
  35. {
  36. if( (x+0.5)>y )
  37. System.out.println(y);
  38. else
  39. System.out.println(y-x-0.50);
  40. }
  41. }
  42. }
Runtime error #stdin #stdout #stderr 0.07s 380160KB
stdin
30 120.00
stdout
Standard output is empty
stderr
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 8192
	at Main.main(Main.java:24)