http://acm.hdu.edu.cn/showproblem.php?pid=2140

Problem Description
I believe many people are the fans of prison break. How clever Michael is!! In order that the message won't be found by FBI easily, he usually send code letters to Sara by a paper crane. Hence, the paper crane is Michael in the heart of Sara. Now can you write a program to help Sara encode the letter from Michael easily?
The letter from Michael every time is a string of lowercase letters. You should encode letters as the rules below:
b is ' ', q is ',', t is '!', m is l, i is e, c is a, a is c, e is i, l is m. It is interesting. Are you found that it is just change michael to leahcim?
 
Input
The input will consist of several cases, one per line.
Each case is a letter from Michael, the letteres won't exceed 10000.
 
Output
For each case, output the encode letter one line.
 
Sample Input
pmicsibforgevibliqbscrct
ebmovibyout
 
Sample Output
please forgive me, sara!
i love you!
 
代码:

#include <bits/stdc++.h>
using namespace std; const int maxn = 1e5 + 10;
char s[maxn];
char a[11]={'b', 'q', 't', 'm', 'i', 'c', 'a', 'e', 'l'};
char b[11]={' ', ',', '!', 'l', 'e', 'a', 'c', 'i', 'm'}; int main() {
while(~scanf("%s", s)) {
int len = strlen(s);
for(int i = 0; i < len; i ++) {
if(s[i] == 'b')
s[i] = ' ';
else if(s[i] == 't')
s[i] = '!';
else if(s[i] == 'm')
s[i] = 'l';
else if(s[i] == 'i')
s[i] = 'e';
else if(s[i] == 'c')
s[i] = 'a';
else if(s[i] == 'a')
s[i] = 'c';
else if(s[i] == 'e')
s[i] = 'i';
else if(s[i] == 'l')
s[i] = 'm';
else if(s[i] == 'q')
s[i] = ',';
} printf("%s\n", s);
}
return 0;
}

  

HDU 2140 Michael Scofield's letter的更多相关文章

  1. HDOJ/HDU 2140 Michael Scofield's letter(字符转换~)

    Problem Description I believe many people are the fans of prison break. How clever Michael is!! In o ...

  2. 越狱Season 1-Episode 1: the pilot

    the pilot: 美国电视剧新剧开播都会有一个试播来测试观众对新剧的接受程度,以此来决定是否再继续播下去,也可以说是一个开端,第一集,试播 -Tattoo Artist: That's it. t ...

  3. hdu3511 Prison Break 圆的扫描线

    地址:http://acm.split.hdu.edu.cn/showproblem.php?pid=3511 题目: Prison Break Time Limit: 10000/5000 MS ( ...

  4. 【Java】Lucene检索引擎详解

    基于Java的全文索引/检索引擎——Lucene Lucene不是一个完整的全文索引应用,而是是一个用Java写的全文索引引擎工具包,它可以方便的嵌入到各种应用中实现针对应用的全文索引/检索功能. L ...

  5. 越狱Season 1-Episode 19: The Key

    Season 1, Episode 19: The Key -Kellerman: WeusedtohaveaGreatDane, Dane: 丹麦大狗 我们以前有一只大丹犬 bigandwild. ...

  6. 越狱Season 1- Episode 18: Bluff

    Season 1, Episode 18: Bluff -Michael: Scofield Scofield Michael Scofield Michael Scofield -Patoshik: ...

  7. 越狱Season 1-Episode 15: By the Skin and the Teeth

    Season 1, Episode 15: By the Skin and the Teeth -Pope: doctor...you can leave. 医生你得离开 -Burrows: It's ...

  8. 越狱Season 1-Episode 12:Odd Man Out

    Season 1-Episode 12:Odd Man Out -Sorry to keep you waiting. 抱歉让你等了半天 -Oh, it's, uh, not a problem. 嗯 ...

  9. 越狱Season 1-Episode 11: And Then There Were 7-M

    Season 1, Episode 11: And Then There Were 7-M -Michael: That one 那个 -businessman: Nice choice choice ...

随机推荐

  1. 11.7 NOIP总复习总结

    好像要1A模板题.完败 下面主要是一波SB错误总结 最小生成树(忘了sort(QwQ)) // It is made by XZZ // Fei Fan Ya Xi Lie~~~ #include&l ...

  2. 一个将当前目录下HEX文件的第一行数据删除的程序

    为什么要写这样一个函数 在使用SoftConsole开发M3程序时,生成的hex文件,必须要把第一行数据删除,才能在Libero中使用,所以写了这个小工具,这是2.0版本了,第一版是直接删除第一行数据 ...

  3. java面试资源(面试题、面试经验等)

    两年JAVA程序员的面试总结 https://www.cnblogs.com/xuwujing/p/7613084.html 2018JAVA面试题附答案(长期更新) https://blog.csd ...

  4. CSS中的height与line-height的区别

    <p class='text'>高与行高的区别</p> 那么我要想让这些字上下居中那么可以用宽度和行高控制 .text{ height:25px; line-height:25 ...

  5. 应用.NET控制台应用程序开发批量导入程序。

    一.最近一直在调整去年以及维护去年开发的项目,好久没有在进行个人的博客了.每天抽了一定的时间在研究一些开源的框架,Drapper 以及NHibernate以及当前比较流行的SqlSuper框架 并进行 ...

  6. 腾讯云服务器linux Ubuntu操作系统搭建ftp服务器vsftpd

    腾讯云服务器linux Ubuntu操作系统安装ftp服务器vsftpd 操作系统: Ubuntu Server 16.04.1 LTS 64位 下面我将系统重装, 一步一步从头开始,安装FTP服务器 ...

  7. LR测试报告分析 -详解

    1. 结果摘要 LoadRunner进行场景测试结果收集后,首先显示的该结果的一个摘要信息,如下图所示.概要中列出了场景执行情况.“Statistics Summary(统计信息摘要)”.“Trans ...

  8. [学习笔记]PCL使用心得

    最近开始做研究生毕设,有一部分因为没有什么好的思路,就把以前用过的PCL点云搬出来,重新用源码装了一遍PCL,一开始装的过程中没什么大问题,在后面用的时候碰到了很多小问题,特此记录. 1.PCL版本问 ...

  9. OpenSSH技术详解

    一.什么是Openssh  OpenSSH 是 SSH (Secure SHell) 协议的免费开源实现.SSH协议族可以用来进行远程控制, 或在计算机之间传送文件.而实现此功能的传统方式,如teln ...

  10. kuberentes 源码编译安装

    下载源码 git clone https://github.com/kubernetes/kubernetes && cd kubernetes # 切换版本分支 git checko ...