ребят посмотрите пожалуйста :)
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 sdmin=Integer.MAX_VALUE;
while (true) {
if(console.hasNextInt()){
int a = console.nextInt();
if (a<min){
min =a;}else if (a>min&&a<sdmin){
sdmin =a;}else if (console.hasNextLine()){
String name= console.nextLine() ;
if(name.equals("exit")){
break;}}}} //напишите тут ваш код
System.out.println(sdmin);
}
}