POJ 2141

继续水

 1 #include <iostream>
 2 #include <cstdio>
 3 #include <cstdlib>
 4 #include <cstring>
 5 using namespace std;
 6 
 7 char f[30];
 8 char st[100];
 9 
10 int main()
11 {
12     gets(f);
13     gets(st);
14     for (int i = 0; i < strlen(st); i++)
15     {
16         if (st[i] <='Z' && st[i] >= 'A')
17             printf("%c",f[st[i] - 'A'] - 'a' + 'A');
18         else if (st[i] <='z' && st[i] >= 'a')
19             printf("%c", f[st[i] - 'a']);
20         else
21             printf("%c", st[i]);
22     }
23     printf("
");
24     return 0;
25 }
View Code
原文地址:https://www.cnblogs.com/jie-dcai/p/4296838.html