31. Caesar Cipher
EasyStringMath
Shift every letter forward in the alphabet by k positions, wrapping around from z to a and keeping case. Other characters are unchanged.
Input format
Line 1: text Line 2: k
Output format
The encrypted text.
Example 1
Input
Hello, World! 3
Output
Khoor, Zruog!
Example 2
Input
xyz 2
Output
zab
Constraints
0 ≤ k ≤ 100
Read input from standard input and print the answer to standard output. Your code is judged against 4 test cases, most of them hidden.
Loading the MyLoginn IDE…