⛴李恒旭⚔♆§ • 2年前
using namespace std;
int main() {
char c[1000];
int a[30], b[30];
char ch = getchar();
int sz = 0;
while (ch != '\n') {
c[++sz] = ch;
ch = getchar();
}
int i;
for (i = 0; i < 26; i++)
scanf("%d", &a[i]);
for (i = 0; i < 26; i++)
scanf("%d", &b[i]);
for (i = 1; i <= sz; i++) {
if (c[i] >= 'A' && c[i] <= 'Z') {
printf("%c", 'A' + (c[i] - 'A' + a[c[i] - 'A'] + 26 * 10000) % 26);
} else if (c[i] >= 'a' && c[i] <= 'z') {
printf("%c", 'a' + (c[i] - 'a' + b[c[i] - 'a'] + 26 * 10000) % 26);
} else if (c[i] == '@' || c[i] == '<' || c[i] == '>' || c[i] == '=' || c[i] == '[' || c[i] == ']')
printf(" ");
else if (c[i] == '.')
printf(",");
else if (c[i] == ',')
printf(".");
else
printf("%c", c[i]);
}
return 0;
}
评论:
请先登录,才能进行评论