Write in C program
Next is a classic topic: Caesar Cipher
Caesar cipher (English: Caesar cipher), also known as Caesar cipher, Caesar transformation, transformation cipher, is one of the simplest and most well-known encryption techniques. The Caesar cipher is a substitution encryption technique in which all letters in the plaintext are replaced with ciphertext after being shifted backwards (or forwards) by a fixed number in the alphabet. For example, when the offset is 3, all letters A will be replaced with D, B with E, and so on. This encryption method is named after Caesar during the Roman Republic, who is said to have used this method to communicate with his generals.
Write a program to perform Caesar encryption (25%)
Enter description:
Enter a string on the first line. The length of the string should be less than 10,000 characters, with only uppercase letters and spaces.
The second line enters the offset offset, which is int.
Output description:
Outputs the encrypted string, and spaces are not encrypted.
Example input 1:
THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
3
Example output 1:
WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ
Example input 2:
THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
-twenty three
U
Example output 2:
WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ