Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int a = scanner.nextInt();
- int b = scanner.nextInt();
- int c = scanner.nextInt();
- if (a==b && b==c){
- System.out.printf("%d %d %d", a,b,c);
- } else {
- sortNums(a, b, c);
- }
- }
- public static void sortNums(int a, int b, int c) {
- if (a >= b && b >= c) {
- System.out.printf("%d %d %d",a,b,c);
- }
- if (b >= a && a >= c) {
- System.out.printf("%d %d %d",b,a,c);
- }
- if (c >= a && a >= b) {
- System.out.printf("%d %d %d",c,a,b);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement