Всем привет! Использовал слегка другой подход к решению, но были соблюдены все условия, а он выдает ошибку... Это я тупой или он?😁
package com.javarush.task.pro.task04.task0408;
import java.util.Scanner;
/*
Максимум из введенных чисел
*/
public class Solution {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int max = Integer.MIN_VALUE;
while (input.hasNextInt())
{
int actual = input.nextInt();
if (actual % 3 == 0)
continue;
else if (actual > max)
max = actual;
}
System.out.println(max);
}
}