fork download
  1. //e-olymp 108. Среднее число
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. class SecondLab
  8. {
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. int a, b, c, average;
  12. Scanner input = new Scanner(System.in);
  13. a = input.nextInt();
  14. b = input.nextInt();
  15. c = input.nextInt();
  16.  
  17. if((a > b && b > c)||(c > b && b > a))
  18. average = b;
  19. else if ((b > a && a > c)||(c > a && a > b ))
  20. average = a;
  21. else
  22. average = c;
  23. System.out.println(average);
  24. }
  25. }
Success #stdin #stdout 0.08s 2841600KB
stdin
7 5 9
stdout
7