#K43797. Alternate Capitalization
Alternate Capitalization
Alternate Capitalization
Given a string s, convert it to an alternating capitalization format where characters in even indices (starting from 0) are converted to uppercase and characters in odd indices are converted to lowercase.
For example, for the string hello
, the output should be HeLlO
.
You are required to process multiple test cases. For each test case, read the input string and output its alternate capitalization result.
The alternate capitalization is defined as follows: for a given string \( s = s_0s_1...s_{n-1} \), the resulting string \( r \) is given by:
[ r_i = \begin{cases} \text{Uppercase}(s_i) & \text{if } i \equiv 0 \pmod{2} \ \text{Lowercase}(s_i) & \text{if } i \equiv 1 \pmod{2} \end{cases} ]
inputFormat
The first line of input contains an integer \( T \) (\( 1 \le T \le 1000 \)), the number of test cases. Each of the following \( T \) lines contains a non-empty string \( s \) composed of English letters.
outputFormat
For each test case, output the alternate capitalization form of the given string on a new line.
## sample3
hello
world
PROGRAMMING
HeLlO
WoRlD
PrOgRaMmInG
</p>