-->
当前位置:首页 > 题库

PROGRAMMING:Caesar Password

Luz5年前 (2021-05-10)题库463
Problem Description:
Caesar cipher is a simple classical cipher, and its encryption principle is: select an integer k (0 < = k < = 25), so that each letter of the original text moves k bits to the right to get ciphertext. Suppose k = 2, then 'a' moves 2 bits to the right and 'C'; ' B 'moving 2 bits is'd'; ' Y 'moves 2 bits back to' a ';' Your task is to program, and its function is to encrypt the original text according to an integer K.
###Input format:
Up to 100 sets of test data. The first line of each group of test data is the integer k (0 < = k < = 25), and the second line is the original text with only lowercase letters. The data length of each group is less than 100. When the integer k is - 1, it means the end of input.
###Output format:
For each group of input, a line of encrypted ciphertext is output to the output file.
###Input example:
Here is a set of inputs. For example:
```in
two
abzy
seven
eat
nine
today
0
hello
-1
```
###Output example:
The corresponding output is given here. For example:
```out
cdba
lha
cxmjh
hello
```







answer:If there is no answer, please comment