#C5468. Transform List: Square Even Numbers
Transform List: Square Even Numbers
Transform List: Square Even Numbers
Given a list of integers, create a new list such that each even integer is squared and each odd integer remains unchanged. Formally, for each integer \( x \) in the list, if \( x \) is even then it is transformed to \( x^2 \) and if it is odd, it remains \( x \). This problem tests basic iteration and conditional logic.
inputFormat
A single line containing a space-separated list of integers. For example: 1 2 3 4 5 6
outputFormat
A single line containing the transformed list with space-separated integers. For the above example, the output should be: 1 4 3 16 5 36## sample
1 2 3 4 5 6
1 4 3 16 5 36