fork download
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. long A = scanner.nextLong();
  7. long B = scanner.nextLong();
  8. long C = scanner.nextLong();
  9.  
  10. long first, second, third;
  11.  
  12. if (A <= B && A <= C) {
  13. first = A;
  14. if (B <= C) {
  15. second = B;
  16. third = C;
  17. } else {
  18. second = C;
  19. third = B;
  20. }
  21. } else if (B <= A && B <= C) {
  22. first = B;
  23. if (A <= C) {
  24. second = A;
  25. third = C;
  26. } else {
  27. second = C;
  28. third = A;
  29. }
  30. } else {
  31. first = C;
  32. if (A <= B) {
  33. second = A;
  34. third = B;
  35. } else {
  36. second = B;
  37. third = A;
  38. }
  39. }
  40.  
  41. System.out.println(first);
  42. System.out.println(second);
  43. System.out.println(third);
  44. System.out.println();
  45. System.out.println(A);
  46. System.out.println(B);
  47. System.out.println(C);
  48.  
  49. scanner.close();
  50. }
  51. }
Success #stdin #stdout 0.17s 54496KB
stdin
34
12
56
stdout
12
34
56

34
12
56