fork download
  1. import java.util.Scanner;
  2. import static java.lang.Integer.max;
  3. import static java.lang.Math.min;
  4.  
  5. public class Main {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8. int a = scanner.nextInt();
  9. int b = scanner.nextInt();
  10. int c = scanner.nextInt();
  11. int minFloor = min(min(a, b), c);
  12. int maxFloor = max(max(a, b), c);
  13. int middleFloor = a + b + c - minFloor - maxFloor;
  14. int resultFloor;
  15. if (31 * (maxFloor - minFloor) < 47 * (middleFloor - minFloor)) {
  16. resultFloor = minFloor;
  17. }
  18. else {
  19. resultFloor = middleFloor;
  20. }
  21. System.out.println(resultFloor);
  22. }
  23. }
Runtime error #stdin #stdout #stderr 0.07s 2184192KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.util.NoSuchElementException
	at java.util.Scanner.throwFor(Scanner.java:862)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at Main.main(Main.java:8)