码迷,mamicode.com
首页 > 其他好文 > 详细

POJ 2141

时间:2015-02-21 09:43:32      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:

继续水

技术分享
 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("\n");
24     return 0;
25 }
View Code

 

POJ 2141

标签:

原文地址:http://www.cnblogs.com/jie-dcai/p/4296838.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!