程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> C++ >> 關於C++ >> HDU 2140 Michael Scofield's letter

HDU 2140 Michael Scofield's letter

編輯:關於C++


Michael Scofield's letter

Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3442 Accepted Submission(s): 2014



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!

Author 李光霞
Source HDU 2007-11 Programming Contest

水題,b is ' ', q is ',', t is '!', m is l, i is e, c is a, a is c, e is i, l is m. 直接暴力。
#include 
#include 
#include 
#include
#include 
#include 
#include 
#include
#include 
#include 
#include 
using namespace std;
#define inf 0x6f6f6f6f
#define mod 10
int main()
{
    char s[10005];
    while(cin>>s)
    {
        int l=strlen(s);
        int i;
        for(i=0; i
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved