#C4818. Filter Even Numbers
Filter Even Numbers
Filter Even Numbers
You are given a list of integers. Your task is to filter and return only the even numbers from this list. An integer \( n \) is even if it satisfies the condition \( n \equiv 0 \ (\bmod\ 2) \). This problem requires you to process standard input and produce the output to standard output.
Example: If the input is 6
as the number of elements followed by 1 2 3 4 5 6
, the output should be 2 4 6
.
inputFormat
The first line contains an integer \( n \), representing the number of elements in the list. The second line contains \( n \) integers separated by spaces.
outputFormat
Output a single line containing all even numbers from the input list separated by a single space. If there are no even numbers, output an empty line.
## sample6
1 2 3 4 5 6
2 4 6