So i've had this issue before. My code works just fine, regardless of what the numbers are it puts them in descending order. Yet, the compiler doesn't like it and won't verify that the code is in fact meeting that condition. Why is that?
package com.codegym.task.task04.task0420;
/*
Sorting three numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String sNum1 = reader.readLine();
String sNum2 = reader.readLine();
String sNum3 = reader.readLine();
int num1 = Integer.parseInt(sNum1);
int num2 = Integer.parseInt(sNum2);
int num3 = Integer.parseInt(sNum3);
if(num1 > num2 && num1 > num3 && num2 > num3){
System.out.println(num1+" "+num2+" "+num3);
}
else if(num1 > num2 && num1 > num3 && num3 > num2){
System.out.println(num1+" "+num3+" "+num2);
}
else if(num2 > num1 && num2 > num3 && num1 > num3){
System.out.println(num2+" "+num1+" "+num3);
}
else if(num2 > num1 && num2 > num3 && num3 > num1){
System.out.println(num2+" "+num3+" "+num1);
}
else if(num3> num1 && num3>num2 && num2> num1){
System.out.println(num3+" "+num2+" "+num1);
}
else if(num3> num1 && num3>num2 && num1> num2){
System.out.println(num3+" "+num1+" "+num2);
}
}
}