Hi, guys!
Can anyone help me? I did some tests and it works. But the last condition is not satisfied.
package com.codegym.task.task04.task0420;
/*
Sorting three numbers
*/
import java.io.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
Scanner keyboard = new Scanner(System.in);
int numberOne = keyboard.nextInt();
int numberTwo = keyboard.nextInt();
int numberThree = keyboard.nextInt();
int maximum = 0;
int medium = 0;
int minimum = 0;
if(numberOne >= numberTwo){
if(numberOne >= numberThree){
maximum=numberOne;
if(numberTwo >= numberThree){
medium = numberTwo;
minimum = numberThree;
} else {
medium = numberThree;
minimum = numberTwo;
}
}else{
maximum=numberThree;
medium = numberOne;
minimum = numberTwo;
}
}else{
if(numberTwo >= numberThree){
maximum = numberTwo;
if(numberOne >= numberThree){
medium = numberOne;
minimum = numberThree;
} else {
medium = numberThree;
minimum = numberOne;
}
}
}
System.out.println(maximum + " " + medium + " " + minimum);
}
}