Nyoj-shift Password
Shift password time limit: 1000 MS | memory limit: 65535 KB difficulty: 0
-
Description
-
The shift password is the simplest alternative to the password. The specific algorithm is to shift the letter of the alphabet to k places (k <26) Right and perform a modulo operation on the letter length.
Here is a string of ciphertext consisting of uppercase letters. It is known that the encryption process is to shift each letter right k digits in alphabetical order.
Encryption function: E (m) = (m + k) % q.
Decrypt the plaintext!
-
Input
-
The input contains multiple groups of test data (less than 1000 groups ).
Each group of data contains a string and an integer k (k <26) separated by spaces. All strings are composed of uppercase letters. The length is less than 50, and k indicates the number of digits that move to the right.
-
Output
-
The plaintext corresponding to each set of ciphertext is output, and each group of output occupies one line.
-
Sample Input
-
JMPWFZPV 1
-
Sample output
-
ILOVEYOU
-
Source
Password Series
#include
#include
int main(){int k;char str[55];while(~scanf("%s",str)){int len=strlen(str),i;scanf("%d",&k);for(i=0;i