Problem Statement
Given a string , you need to return the transformed string according to the following rule: If a character is a letter, it should be transformed to the next letter in the alphabet, except 'z' and 'Z', which should wrap around to 'a' and 'A', respectively. The capitalization should be preserved.
That is, 'a' becomes 'b', 'b' becomes 'c',..., 'y' becomes 'z', and 'z' becomes 'a'; 'A' becomes 'B',..., 'Z' becomes 'A'.
However, all other non-letter characters should remain unchanged.
Input Specification
The first line of the input gives the number of test cases, , test cases follow. Each test case consists of a line. The line contain a string .
Limits
Memory limits: 32MB.
Time limits: 1 second.
Test Set 1
Sample Case.
Test Set 2
The string will not contain 'z','Z' or non-letter character.
Test Set 3
The string will not contain non-letter character.
Test Set 4
No limitation.
Output Specification
For each test case, output one line containing Case #x: y
, where is the case number(starting from 1) and is the transformed string.
Sample Input
2
Python3.7 is fun!
May I take Zoology 101 @ NTHU?
Sample Output
Case #1: Qzuipo3.7 jt gvo!
Case #2: Nbz J ublf Appmphz 101 @ OUIV?
Hint
chr
ord
mod operator
Comments