#C4814. Atbash Cipher Encryption
Atbash Cipher Encryption
Atbash Cipher Encryption
In this problem, you are required to implement the Atbash cipher encryption. The Atbash cipher works by substituting each letter in the English alphabet with its corresponding letter in the reverse order. That is, 'a' is replaced by 'z', 'b' by 'y', 'c' by 'x', and so on. Uppercase letters should be treated similarly, e.g. 'A' is replaced by 'Z'. Non-alphabetical characters (such as digits, punctuation, and whitespace) remain unchanged.
Example:
- If the input is
hello world!
, then the output should besvool dliow!
. - If the input is
Code123!
, then the output should beXlwv123!
.
Your task is to read an input string from standard input, transform it using the Atbash cipher as described and print the resulting string to standard output.
Note: Make sure to handle both uppercase and lowercase letters appropriately.
inputFormat
The input consists of a single line containing the string s to be encrypted.
outputFormat
Output a single line representing the encrypted string after applying the Atbash cipher.
## samplehello world!
svool dliow!