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