import java.util.*;
// The main method must be in a class named "Main".
class Main {
public static void main(String[] args) {
Scanner tec = new Scanner (System.in);
System.out.println ("Introduce los numeros que quiere ordenar: ");
double n1 =tec.nextDouble();
double n2 =tec.nextDouble();
double n3 =tec.nextDouble();
tec.close();
double no1,no2,no3;
if (n1>=n2 && n1>=n3){
no1=n1;
if(n2>=n3){
no2=n2;
no3=n3;
}
else{
no2=n3;
no3=n2;
}
}
else if (n2>=n3){
no1=n2;
if (n3>=n1){
no2= n3;
no3= n1;
}
else{
no2= n1;
no3= n3;
}
}
else{
no1=n3;
if (n1>=n2){
no2 = n1;
no3= n2;
}
else{
no2 = n2;
no3= n1;
}
}
System.out.println ("¡Resuelto! El resulta final es que el orden de mayor a menos es: "+no1+" ,"+no2+" ,"+no3);
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: