#C10795. Zero Even Number Replacement
Zero Even Number Replacement
Zero Even Number Replacement
You are given an array of integers. Your task is to replace every even number in the array with zero, while leaving all odd numbers unchanged. Formally, for each integer \(a\) in the array, if \(a\) is even then it becomes \(0\); if it is odd, it remains \(a\).
The input is provided via standard input and the output must be printed to standard output. The first line of input contains an integer \(n\) denoting the number of elements in the array. The second line contains \(n\) space-separated integers.
Output the resulting modified array as a single line of space-separated integers.
inputFormat
The input format is as follows:
- The first line contains a single integer \(n\) (\(0 \le n \le 10^5\)), the number of elements in the array.
- The second line contains \(n\) space-separated integers, each in the range \([-10^9, 10^9]\).
outputFormat
Print a single line containing \(n\) space-separated integers that represent the transformed array where every even integer has been replaced by zero.
## sample4
2 4 6 8
0 0 0 0