Hi, looks like code is working fine(input 3,5,7; output 7 5 3), but still I am failing in last condition.
I remember that with arrays sorting is much easier(can google it), but wanted to try with IF.
Thanks.
package com.codegym.task.task04.task0420;
/*
Sorting three numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String xa = reader.readLine();
String xb = reader.readLine();
String xc = reader.readLine();
int a = Integer.parseInt(xa);
int b = Integer.parseInt(xb);
int c = Integer.parseInt(xc);
if(a<=c&&a<=b&&b<=c){
System.out.println(c +" "+b+" "+a);
}
if(a<=c&&a<=b&&b>=c){
System.out.println(b +" "+c+" "+a);
}
if(a<=c&&a>=b&&b<=c){
System.out.println(c +" "+a+" "+b);
}
if(a>=c&&a<=b&&b>=c){
System.out.println(b +" "+a+" "+c);
}
if(a>=c&&a>=b&&b<=c){
System.out.println(a +" "+c+" "+b);
}
if(a>=c&&a>=b&&b>=c){
System.out.println(a +" "+b+" "+c);
}
}
}