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

PROGRAMMING:Caesar cipher

Luz5年前 (2021-05-10)题库480
In order to prevent the information from being stolen easily, it is necessary to transform the plaintext into ciphertext by means of encryption. Enter a character string with carriage return as the end mark (less than 80 characters), and then enter an integer offset, which is encrypted with Caesar password and output. Caesar cipher is a simple replacement encryption technology, which replaces all letters in plaintext with ciphertext after offset bit in alphabet. When offset is greater than zero, it means backward offset; When offset is less than zero, it means forward offset.
###Input format:
Input the first line to give a non empty string (less than 80 characters) ending with carriage return; On the second line, enter an integer offset.
###Output format:
Output the encrypted result string.
###Input sample 1:
```in
Hello Hangzhou
two
```
###Output sample 1:
```out
Jgnnq Jcpibjqw
```
###Input sample 2:
```in
a=x+y
-1
```
###Output sample 2:
```out
z=w+x
```







answer:If there is no answer, please comment