Skip to content

Instantly share code, notes, and snippets.

@gonaumov
Created September 13, 2020 21:51
Show Gist options
  • Save gonaumov/ed945db3482160953bc92cf7fd073a2b to your computer and use it in GitHub Desktop.
Save gonaumov/ed945db3482160953bc92cf7fd073a2b to your computer and use it in GitHub Desktop.
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int max = 0;
while (scanner.hasNextInt()) {
int input = scanner.nextInt();
if (input % 4 == 0 && input > max) {
max = input;
}
}
System.out.println(max);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment