fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12.  
  13.  
  14. int a = Integer.parseInt(reader.readLine());
  15. int b = Integer.parseInt(reader.readLine());
  16. int c = Integer.parseInt(reader.readLine());
  17.  
  18.  
  19. int biggest = max(max(a, b ) , c);
  20.  
  21. int lowest = min(min(a, b), c);
  22.  
  23. int mid = mid(a, b, c);
  24.  
  25. System.out.println(biggest);
  26.  
  27. System.out.println(mid);
  28.  
  29. System.out.println(lowest);
  30. }
  31.  
  32. public static int max(int a, int b) {
  33.  
  34. if (a < b)
  35. return b;
  36.  
  37. else
  38. return a;
  39. }
  40.  
  41. public static int min(int a, int b) {
  42.  
  43. if (a > b)
  44. return b;
  45.  
  46. else
  47. return a;
  48.  
  49.  
  50. }
  51.  
  52. public static int mid(int a, int b, int c) {
  53.  
  54. if (a >= b && c >= a)
  55. return a ;
  56.  
  57. if (a >= c && b >= a)
  58. return a;
  59.  
  60. if (b >= a && c >= b)
  61. return b;
  62.  
  63. if (c >= a && b >= c)
  64. return c;
  65.  
  66. if (c >= b && a >= c)
  67. return c;
  68.  
  69. if (b >= c && a >= b)
  70. return b;
  71.  
  72. return 0;
  73.  
  74. }
  75. }
Success #stdin #stdout 0.05s 711168KB
stdin
3
4
1
stdout
4
3
1