300802: CF153C. Caesar Cipher
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Caesar Cipher
题意翻译
### 题目描述 输入一个由大写字母构成的字符串 $s$ ,求 $s$ 的每一个字母往后移 $k$ 位的结果。当字母移动后超出 $\texttt{Z}$ 时,回到字母表的开头 $\texttt{A}$ 继续移动。 ### 输入格式 第一行一个字符串 $s$ (长度在 $1$ 到 $10$ 之间)。 第二行一个整数 $k\ (0 \le k \le 25)$。 ### 输出格式 一行一个字符串,表示 $s$ 的每一个字母往后移 $k$ 位的结果。题目描述
Caesar cipher is one of the simplest encryption techniques. To transform the original message into encrypted one using key $ k $ , one has to replace each letter with a letter which is $ k $ positions later in the alphabet (if this takes the position beyond Z, the rest of it is counted from the start of the alphabet). In a more formal way, if letters of the alphabet are enumerated starting with $ 0 $ , the result of encryption for character $ x $ will be ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF153C/0bcdfffb3b376cab4d59991539b7c4c59be3e11b.png) ( $ 26 $ is the number of letters in the Latin alphabet). You are given the original message and the encryption key $ k $ . Output the resulting cipher.输入输出格式
输入格式
The first line of input contains the original message — a sequence uppercase Latin letters («A»-«Z»). The length of the message is from $ 1 $ to $ 10 $ , inclusive. The second line contains an integer $ k $ ( $ 0<=k<=25 $ ).
输出格式
Output the result of encryption.
输入输出样例
输入样例 #1
CODEFORCES
5
输出样例 #1
HTIJKTWHJX
输入样例 #2
WIXYZILWYM
6
输出样例 #2
CODEFORCES