Запускаю код в сторонней программе Jvdroid, весь функционал отрабатывает. А в IDE JavaRash выдает надписи красным.
import java.util.Scanner;
public class Solution
{
public static void main(String[] args)
{
Scanner console = new Scanner(System.in);
int x, xMin, x2min;
if (!console.hasNextInt())
return;
else
{
x=console.nextInt();
xMin=x;
x2min=x;
}
while (console.hasNextInt())
{
x = console.nextInt();
if (x<xMin)
{
x2min = xMin;
xMin = x;
}
System.out.println(x);
}
System.out.println(x2min+" "+xMin);
}
}