#C596. Shifted Alphabet
Shifted Alphabet
Shifted Alphabet
You are given a string s consisting only of uppercase English letters (A-Z), and an integer shift. Your task is to shift each character in the string by shift positions in the alphabet, with wrapping around from Z back to A.
The transformation for each character c is given by the formula:
\(\text{new\_char} = \left((\text{ord}(c) - \text{ord}('A') + shift) \mod 26\right) + \text{ord}('A')\)
Output the resulting string after all characters have been shifted.
inputFormat
The input consists of two lines:
- The first line contains a string s consisting of uppercase English letters (A-Z).
- The second line contains an integer shift representing the number of positions to shift each letter.
outputFormat
Output a single line containing the shifted string.
## sampleABC
0
ABC