编程介的小学生
2017-11-26 07:12
采纳率: 92.7%
浏览 661
已采纳

Michael Scofield's letter

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!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • blownewbee 2018-02-26 14:49
    已采纳
    点赞 评论
  • wtf178 2018-02-04 16:30

    char sourcestring[7] = "\0",desstring[7] = "\0",char cinput[10000] = "\0";
    strcpy(sourcestring,"michael");
    strcpy(desstring,"leahcim");
    strcpy(cinput,"pmicsibforgevibliqbscrct");
    int len= strlen(cinput),count = 0,smallcount = 0,smalllen = strlen(sourcestring);
    for(; count < len; count ++)
    {
    for(smallcount = 0 ;smallcount < ; smallcount ++)
    (
    if(cinput[count] == sourcestring[smallcount])
    {
    cinput[count] = desstring[smallcount];
    break;
    }
    )
    }
    printf(%s,cinput,len);

    点赞 评论

相关推荐 更多相似问题