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