n a^o7 ! (簡單的字串處理)__字串

來源:互聯網
上載者:User

1、題目:

n a^o7 ! Time Limit: 1000MS    Memory limit: 65536K 題目描述

All brave and intelligent fighters, next you will step into a distinctive battleground which is full of sweet and happiness. If you want to win the battle, you must do warm-up according to my instructions, which can make you in the best state preparing to fight. Now please relax yourself and enjoy the good moment. Before you raise your sharp sword to the enemy who guards the battleground, please allow me to tell you a true and romantic story about a samurai like you.
Samurai hh fell in love with girl ss, who is charming and demure. He realized the truth that he must spend his remaining life with ss, and resolved to pursue the hard-won affection. One day hh wrote a letter to ss, when she opens the letter with excitement her mind was in tangle. She found herself completely not to figure out the meaning about the letter, which said that "n 55!w ! pue n a^o7 ! n paau !". ss also immersed herself in guessing the meaning of that letter for a long time because of her adore to hh. Finally she called hh to ask the meaning of the letter. On the other side of the phone, hh was too nervous to say. Gradually he calmed down himself and told ss to reverse the letter and read it. Then on both ends of the phone comes the voice at the same time "i need u i love u and i miss u".
ss wants to tell each of you however you are Brave And Skilled, you shouldn't forget to express your loyal love and romantic feelings to your prince or princess.
Now the horn sounds for battle,do it by the following input and output. I think each of you will get an "Accepted" in this battle with pleasant mood. 輸入

Input contains an integer T in the first line, and then T lines follow .Each line contains a message (only contain 'n5!wpuea^o7!' and
' '(space)), the message's length is no more than 100. 輸出

Output the case number and the message. (As shown in the sample output)

樣本輸入

2n 55!w ! pue n a^o7 ! n paau !n5!wpuea^o7
樣本輸出
Case 1: i need u i love u and i miss uCase 2: loveandmisu

 

2、代碼:

#include<stdio.h>#include<string.h>int main(){    int n;    scanf("%d",&n);    for(int cas=1;cas<=n;cas++)    {        char s[110];        if(cas==1)        getchar();        //scanf("%s",s);        gets(s);        //printf("%s\n",s);        printf("Case %d: ",cas);        for(int i=strlen(s)-1;i>=0;i--)        {            if(s[i]=='n')            printf("u");            if(s[i]=='5')            printf("s");            if(s[i]=='!')            printf("i");            if(s[i]=='w')            printf("m");            if(s[i]=='p')            printf("d");            if(s[i]=='u')            printf("n");            if(s[i]=='e')            printf("a");            if(s[i]=='a')            printf("e");            if(s[i]=='^')            printf("v");            if(s[i]=='o')            printf("o");            if(s[i]=='7')            printf("l");            if(s[i]==' ')            printf(" ");        }        printf("\n");    }    return 0;}


 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.