Не понимаю, все сделано правильно. Намеренно отказался от использования массива, поскольку это следующий уровень. Проверял во всех вариантах, с отрицательными и равными числами, а условие не проходит. В чем дело?
package com.javarush.task.task06.task0622;
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));
int x1 = Integer.parseInt(reader.readLine());
int x2 = Integer.parseInt(reader.readLine());
int x3 = Integer.parseInt(reader.readLine());
int x4 = Integer.parseInt(reader.readLine());
int x5 = Integer.parseInt(reader.readLine());
int max = 0;
int min = 0;
int i = 1;
if (x1 <= x2 & x1 <= x3 & x1 <= x4 & x1 <= x5) min = x1;
if (x2 <= x1 & x2 <= x3 & x2 <= x4 & x2 <= x5) min = x2;
if (x3 <= x1 & x3 <= x2 & x3 <= x4 & x3 <= x5) min = x3;
if (x4 <= x1 & x4 <= x2 & x4 <= x3 & x4 <= x5) min = x4;
if (x5 <= x1 & x5 <= x2 & x5 <= x3 & x5 <= x4) min = x5;
//System.out.println(min);
while (i <= 5)
{
if (x1 >= x2 & x1 >= x3 & x1 >= x4 & x1 >= x5) {max = x1; System.out.println(x1); x1 = min; ++i;}
else
if (x2 >= x1 & x2 >= x3 & x2 >= x4 & x2 >= x5) {max = x2; System.out.println(x2); x2 = min; ++i;}
else
if (x3 >= x1 & x3 >= x2 & x3 >= x4 & x3 >= x5) {max = x3; System.out.println(x3); x3 = min; ++i;}
else
if (x4 >= x1 & x4 >= x2 & x4 >= x3 & x4 >= x5) {max = x4; System.out.println(x4); x4 = min; ++i;}
else
if (x5 >= x1 & x5 >= x2 & x5 >= x3 & x5 >= x4) {max = x5; System.out.println(x5); x5 = min; ++i;}
}
//System.out.println(min);
}
}