#abc294a. A - Filter

A - Filter

Score : 100100 points

问题描述

给定一个包含 NN 个整数的序列:A=(A1,A2,,AN)A=(A_1,A_2,\ldots,A_N)

按照原顺序打印出 AA 中的所有偶数。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given a sequence of NN integers: A=(A1,A2,,AN)A=(A _ 1,A _ 2,\ldots,A _ N).

Print all even numbers in AA without changing the order.

Constraints

  • 1N1001\leq N\leq 100
  • 1Ai100 (1iN)1\leq A _ i\leq 100\ (1\leq i\leq N)
  • AA contains at least one even number.
  • All values in the input are integers.

Input

The input is given from Standard Input in the following format:

NN

A1A _ 1 A2A _ 2 \ldots ANA _ N

Output

Print a line containing the sequence of all even numbers in AA, with spaces in between.

Sample Input 1

5
1 2 3 5 6

Sample Output 1

2 6

We have A=(1,2,3,5,6)A=(1,2,3,5,6). Among them are two even numbers, A2=2A _ 2=2 and A5=6A _ 5=6, so print 22 and 66 in this order, with a space in between.

Sample Input 2

5
2 2 2 3 3

Sample Output 2

2 2 2

AA may contain equal elements.

Sample Input 3

10
22 3 17 8 30 15 12 14 11 17

Sample Output 3

22 8 30 12 14

update @ 2024/3/10 12:13:19

}