Задача решается, но 3 условие не засчитывается... В чем может быть проблема?
package com.javarush.task.pro.task04.task0410;
import java.util.Scanner;
/*
Второе минимальное число из введенных
*/
public class Solution {
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
int a = Integer.MAX_VALUE;
int b = Integer.MAX_VALUE;
while (console.hasNextInt())
{
int x = console.nextInt();
if (b != Integer.MAX_VALUE && x < a) {
a = x;
}
else if (a == Integer.MAX_VALUE || x > a && x < b) {
b = x;
}
}
if (a > b) {
System.out.println(a);
}
else if (b > a) {
System.out.println(b);
}
}
}