#K55147. Alphabet Shift Transformation
Alphabet Shift Transformation
Alphabet Shift Transformation
You are given a series of strings. For each string, you are required to transform it by replacing every character with the next character in the English alphabet in a cyclic manner. This means that 'z' should be transformed to 'a'.
The input will consist of several lines. You should process each line until you encounter a line that contains only an asterisk *
(without quotes); at that point, you should stop processing further lines.
Note: The transformation is done character by character. If the input string is empty, output an empty string.
For example:
abc
transforms tobcd
xyz
transforms toyza
hello
transforms toifmmp
The internal transformation can be described with the formula: \[ f(c)=\begin{cases} a & \text{if } c=z,\\ c+1 & \text{if } c\neq z \end{cases} \]
inputFormat
The input is given via standard input (stdin) and consists of several lines. Each line contains a single string composed of lowercase letters. The processing stops when you encounter a line that consists solely of an asterisk (*
), which should not be processed.
outputFormat
For each processed input line, print the resulting transformed string on its own line to standard output (stdout).
## sampleabc
xyz
hello
*
bcd
yza
ifmmp
</p>