Выдает ошибку error: 'else' without 'if', хотя else в If. Не могу разобраться.
package com.javarush.task.pro.task04.task0408;
import java.util.Scanner;
/*
Максимум из введенных чисел
*/
public class Solution {
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
int max = 0;
while (console.hasNextInt())
{
int x = console.nextInt();
if (x > max){
if ((x % 2) != 0){
continue;
}
max = x;
else {
System.out.print(max = Integer.MIN_VALUE);
}
}
}
System.out.println(max);
}
}