Не понимаю почему условие не проходит, что нужно исправить?
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 = console.nextInt();
int b = console.nextInt();
int firstMin = a <= b ? a : b;
int secondMin = a <= b ? b : a;
while (console.hasNextInt()){
int c = console.nextInt();
if (c < firstMin){
secondMin = firstMin;
firstMin = c;}
else if (c > firstMin){
secondMin = c;
}
}
System.out.println(secondMin);
}
}
