#include <stdio.h>
#define LEN 55
int t, n, m;
char plaintext[2][LEN], ciphertext[2][LEN];
int h[2][26];
int main() {
scanf("%d", &t);
for (int i = 1; i <= t; i++) {
scanf("%d%d", &n, &m);
scanf("%s%s%s", plaintext[0], ciphertext[0], ciphertext[1]);
int shift = plaintext[0][0] - ciphertext[0][0]; //或者相反
for (int i = 0; i < m; i++) plaintext[1][i] = (ciphertext[1][i] - 'A' + shift + 26) % 26 + 'A';
plaintext[1][m] = '\0'; //多组cases
printf("Case #%d: %s\n", i, plaintext[1]);
}
return 0;
}
计蒜客之模拟篇
最新推荐文章于 2022-11-23 16:23:00 发布