#C10003. Balanced String Transformation
Balanced String Transformation
Balanced String Transformation
The task is to transform a given string s
into its "balanced" version by mirroring each character with respect to the middle of the English alphabet. For every letter \( c \) in the string, its mirrored counterpart is defined as:
\( \text{mirror}(c) = a_{25 - \text{index}(c)} \)
where \( a_0 = 'a' \) and \( a_{25} = 'z' \). For instance, the letter 'a' transforms into 'z', 'b' into 'y', and so on. Your program should read the input string from standard input and output the transformed string to standard output. It is guaranteed that the input string contains only lowercase English letters.
inputFormat
The input is provided via standard input. It consists of a single line containing the string s
(with only lowercase English letters).
outputFormat
Output the "balanced" version of the string s
to standard output. That is, for each character, output its mirror as defined above.
abc
zyx