hdu 2716

地址:http://acm.hdu.edu.cn/showproblem.php?pid=2716

题意:第一行给出一个字母表的排列。用其解密第二行的文本。

代码:

 1 # include <stdio.h>
 2 
 3 
 4 
 5 int main ()
 6 {
 7     char tab[30], str[100] ;
 8     
 9     int i ;
10     while (gets (tab))
11     {
12         gets (str) ;
13         for(i = 0 ; str[i] ; i++)
14         {
15             if (str[i] >= 'a' && str[i] <= 'z')
16                 putchar (tab[str[i]-'a']) ;
17             else if (str[i] >= 'A' && str[i] <= 'Z')
18                 putchar (tab[str[i]-'A']-'a'+'A') ;
19             else putchar (str[i]) ;
20         }
21         printf ("\n") ;
22     }
23     return 0 ;
24 }

转载于:https://www.cnblogs.com/lzsz1212/archive/2012/06/10/2543864.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值