#C12271. Even and Odd Transformation
Even and Odd Transformation
Even and Odd Transformation
Given a list of integers, transform each integer based on its parity. For each even number, output its square, and for each odd number, output its double. The transformations are given by the formulas:
Even: \(x^2\)
Odd: \(2x\)
The program must read input from standard input and write the output to standard output.
inputFormat
The input consists of a single line containing space-separated integers. If the line is empty, there are no integers to process.
outputFormat
Output the transformed list of integers in a single line, separated by a single space. There should be no trailing spaces.
## sample2 4 6
4 16 36