Skip to content

Instantly share code, notes, and snippets.

@StrixG
Created October 18, 2015 20:18
Show Gist options
  • Save StrixG/cbd03322316ebcb80b38 to your computer and use it in GitHub Desktop.
Save StrixG/cbd03322316ebcb80b38 to your computer and use it in GitHub Desktop.
Задача №64. Вывести четные элементы
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int[] array = new int[in.nextInt()];
for (int i = 0; i < array.length; i++) {
array[i] = in.nextInt();
}
for (int i = 0; i < array.length; i ++) {
if (array[i] % 2 == 0) {
System.out.println(array[i]);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment