Advertisement
PavlinBodurov

Untitled

Dec 25th, 2018
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7. public static void main(String[] args) {
  8. Scanner in = new Scanner(System.in);
  9.  
  10. int a = in.nextInt();
  11. int b = in.nextInt();
  12. int c = in.nextInt();
  13.  
  14. if (a >= b && b >= c) {
  15. System.out.printf("%d %d %d",a,b,c);
  16. } else if (b >= a && a >= c) {
  17. System.out.printf("%d %d %d",b,a,c);
  18. } else if (c >= a && a >= b) {
  19. System.out.printf("%d %d %d",c,a,b);
  20. } else if (c >= a && b >= a) {
  21. System.out.printf("%d %d %d",c,b,a );
  22. } else if (a >= b && c >= b && a >= c) {
  23. System.out.printf("%d %d %d",a,c,b);
  24. } else if (b >= a && c >= a) {
  25. System.out.printf("%d %d %d",b,c,a);
  26. }
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement