#C7438. Secret Message Encoder
Secret Message Encoder
Secret Message Encoder
In this problem, you are given a message and an integer shift value. Your task is to encode the message using a Caesar cipher, where each alphabetic character is shifted forward by the given number of positions in the alphabet. Non-alphabetic characters should remain unchanged.
The transformation for lowercase letters is given by the formula: [ new_pos = ((ord(c) - ord('a') + shift) \mod 26) + ord('a') ] and similarly for uppercase letters.
For example, if the input message is hello
with a shift of 3, the output should be khoor
.
inputFormat
The input consists of two lines. The first line contains the message (a string). The second line contains an integer representing the shift value.
outputFormat
Output a single line which contains the encoded message after applying the Caesar cipher shift.## sample
hello
3
khoor