Caesar cipher - MarisaOJ: Marisa Online Judge

Caesar cipher

Time limit: 1000 ms
Memory limit: 256 MB
The Caesar Cipher is a simple encryption technique that shifts each letter in the plaintext by a fixed number of positions down or up the alphabet. For example, with a shift of 3: - a becomes d. - b becomes e. - hello becomes kh∞r. - z∞ becomes crr. Write a program that takes as input a string and a shift value, and performs encryption using the Caesar Cipher. ### Input - The first line contains a string S consisting of lowercase letters and spaces. - The second line contains an integer k (0≤k≤25), the shift value. ### Output - Print the encrypted string after shifting each letter in S by k positions. ### Constraints - 1≤|S|≤1000. - 0≤k≤25. ### Sample test marisa3 Output: pdv̲d