Да выглядит очень бредово, но работает. Валится на проверке 0 0 15. Как исправить?
package com.javarush.task.task04.task0420;
/*
Сортировка трех чисел
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String sa = reader.readLine();
String sb = reader.readLine();
String sc = reader.readLine();
int a = Integer.parseInt(sa);
int b = Integer.parseInt(sb);
int c = Integer.parseInt(sc);
int min = check(a, b);
int min2 = check(min, c);
int max = check2(a, b);
int max2 = check2(max,c);
System.out.print(max2 + " ");
if(a <= b)
if (b <= c)
System.out.print(b);
if(b <= a)
if (a <= c)
System.out.print(a);
if(a <= c)
if (c <= b)
System.out.print(b);
System.out.print(" " + min2);
}
public static int check(int a, int b){
if (a >= b)
return b;
else
return a;
}
public static int check2(int a, int b){
if (a <= b)
return b;
else
return a;
}
}