#K48012. Capitalize Even-Positioned Words
Capitalize Even-Positioned Words
Capitalize Even-Positioned Words
You are given a sentence where words are separated by a single space. Your task is to transform the sentence such that every word at an even position (i.e., the 2nd, 4th, etc. word when counted from 1) is converted to uppercase, while the rest of the words remain unchanged.
For example, given the sentence "hello world this is a test", the resulting output should be "hello WORLD this IS a TEST".
The transformation should preserve the single space between words.
inputFormat
The input consists of a single line containing a sentence with words separated by a single space. The sentence may contain punctuation and is not guaranteed to end with a newline character.
outputFormat
Output the modified sentence in which every word at an even position is capitalized. Word positions are considered 1-indexed.
## samplehello world this is a test
hello WORLD this IS a TEST