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. mfc 类成员函数

    知识点 类成员变量初值 类的构造函数 类成员函数 类成员函数的位置 一.类成员变量初值 二.类的构造函数 构造函数 是一种特殊的方法,主要用来在创建对象时初始化对象,即为对象成员变量赋初始值. 构造函 ...

  2. 9.12 开课第9天 (JS脚本语音:基础语法、语句)

    全称JavaScript    网页里面使用的脚本语音      非常强大的语言 基础语法:1.注释语法   单行注释//    多行注释/**/ 2.输出语法   alert(信息);  弹出信息  ...

  3. error: this 'if' clause does not guard... [-Werror=misleading-indentation]

    解决办法就是if语句的下面加{} 报错的 if (!pMem) return LOS_NOK; 修改后 if (!pMem) { return LOS_NOK; }

  4. noip2017 PJ AK记

    嗨小朋友们大家好,还记得我是谁吗?我就是为RE代言的蒟蒻--xzz day1 蛤?四楼只有一个考场???在逗我 然后解压 蛤?空军68年????我怎么不知道???huaji 蛤?T1这么sb?切掉 蛤 ...

  5. Storm 第一章 核心组件及编程模型

    1 流式计算 流式计算:数据实时产生.实时传输.实时计算.实时展示 代表技术:Flume实时获取数据.Kafka/metaq实时数据存储.Storm/JStorm实时数据计算.Redis实时结果缓存. ...

  6. windows10如何将python2和python3添加到环境变量中

    点击我的电脑----->右键‘属性’----->高级系统管理-------->高级-------->环境变量------>新建------->此时输入变量名和变量值 ...

  7. Python无参装饰器

    需求:想要在test_func函数前后执行一些代码   1.第一步(定义函数,将调用原函数,使用新函数替换) def test_func(): return 'test_func' def test_ ...

  8. day01_概念

    1 网络分类: 1 按照范围: - 局域网:范围很小的网络,如一间办公室,一个公司 - 城域网:大致城市范围内的网络,半径几公里到几十公里 - 广域网:比城域网范围更大的 2 网络衡量标准 1 传输速 ...

  9. AutomaticInteger中CAS运用分析

    摘要 在接触CAS的时候虽然对它流程了解了但是对其如何解决并发问题还是一直有疑问的,所以在就选择了java中典型线程安全的AtomicInteger类进行了源码的分析. CAS简介 CAS的全称为co ...

  10. Laya1.x Timer小记

    Timer是时钟管理类,在Laya初始化的时候会创建一个实例,通过Laya.timer访问. TimerHandler TimerHandler是对每一个定时任务的封装,每次调用frameOnce.f ...