#K11276. Alphabetic Position Transformation
Alphabetic Position Transformation
Alphabetic Position Transformation
You are given a list of words. For each word, you need to transform it by appending after each character its corresponding position in the English alphabet. That is, for every letter \( c \) in the word, append \( \text{ord}(c)-\text{ord}(\text{'a'})+1 \) immediately after the letter.
For example, the word abc
is transformed into a1b2c3
because 'a' is the 1st letter, 'b' is the 2nd letter, and 'c' is the 3rd letter. Similarly, the word hello
is transformed into h8e5l12l12o15
.
If a word is empty, output an empty string for it.
Note: The position of characters is determined by their place in the alphabet, i.e. \( a=1,\, b=2,\, \ldots,\, z=26 \).
inputFormat
The first line of input contains an integer ( n ), representing the number of words. The following ( n ) lines each contain a single word consisting only of lowercase English letters.
outputFormat
For each input word, output its transformed form on a new line. In the transformed word, each character is immediately followed by its position in the alphabet. For example, the transformation for 'abc' produces 'a1b2c3'.## sample
1
abc
a1b2c3
</p>