Какие проверки нужно сделать чтоб все условия проходили?
package com.javarush.task.pro.task04.task0408;
import java.util.Scanner;
/*
Максимум из введенных чисел
*/
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int max = 0;
int min = Integer.MIN_VALUE;
if (!sc.hasNextInt()){
System.out.println(min);
}
else{
while (sc.hasNextInt()){
int x = sc.nextInt();
if (x%2==0){
if (x>max){
max = x;
}
}
}
if (max==0){
System.out.println(min);
}else{
System.out.println(max);
}
}
}
}
белыхположительных чисел. -3 -2 -1 e -> max = -1