Хотя в выводе у меня 3 2 1
package com.javarush.task.task04.task0420;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
Сортировка трех чисел
*/
public class Solution {
public static void main(String[] args) throws Exception {
//напишите тут ваш код
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s1 = reader.readLine();
int x1 = Integer.parseInt(s1);
String s2 = reader.readLine();
int x2 = Integer.parseInt(s2);
String s3 = reader.readLine();
int x3 = Integer.parseInt(s3);
System.out.print(e1(x1,x2,x3)+" "+e2(x1,x2,x3)+" "+e3(x1,x2,x3));
}
public static int e1(int a,int b,int c) {
if (a>b && a>c)
return a;
else if (b>a && b>c)
return b;
else
return c;
}
public static int e3(int a,int b,int c) {
if (a<b && a<c)
return a;
else if (b<a && b<c)
return b;
else
return c;
}
public static int e2(int a,int b,int c) {
int e11 = e1(a,b,c);
int e13 = e3(a,b,c);
if (a<e11 && a>=e13)
return a;
else if (b<e11 && b>=e13)
return b;
else
return c;
}
}