Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Task2_5_2 {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int n = sc.nextInt();
- int[] numArr = new int[n];
- for (int i = 0; i < n; i++) {
- numArr[i] = sc.nextInt();
- }
- for (int j = 0; j < n; j++) {
- if ((numArr[j] % 2) == 0)
- System.out.print(numArr[j] + " ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment