Что-то не пойму почему не проходит условие.. посоветуйте что нибудь. ну или укажите косяк в логике плз
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 min=Integer.MAX_VALUE;
int minsec=Integer.MAX_VALUE;
while (console.hasNextInt())
{ int x=console.nextInt ();
if (x<min)
{minsec=min;
min=x; }
else
{ minsec=x; }
}
System.out.println(minsec);
} }