I tested my code with various combinations and it always does it correct, but it says that the numbers are not descending.Why?
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));
int a = Integer.parseInt(reader.readLine());
int b = Integer.parseInt(reader.readLine());
int c = Integer.parseInt(reader.readLine());
int first = 0;
int mid = 0;
int last = 0;
if (a > b) {
if (a > c) {
first = a;
if (b > c) {
mid = b;
last = c;
} else {
mid = c;
last = b;
}
} else {
first = c;
mid = a;
last = b;
}
} else if (b > a) {
if (a > c) {
first = b;
mid = a;
last = c;
} else {
if(b > c) {
first = b;
mid = c;
} else {
first = c;
mid = b;
}
last = a;
}
}
System.out.println(first + " " + mid + " " + last);
}
}