n a^o7 !

题目描述

 

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 u
Case 2: loveandmisu

提示


将字符串翻转替换输出。
#include <iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[]="n5!wpuea^o7";
char b[]="usimdnaevol";
int main()
{
    int t,n;
    scanf("%d",&t);
    getchar();
    for(int k=1;k<=t;k++)
    {
        char s[110];
        gets(s);
        n=strlen(s);
        int j;
        for(int i=0;i<n;i++)
            for(j=0;j<12;j++)
            if(s[i]==a[j])
            {
                s[i]=b[j];
                break;
            }
            printf("Case %d: ",k);
            for(int i=n-1;i>=0;i--)
                 printf("%c",s[i]);
            printf("\n");
    }
    return 0;
}
#include<bits/stdc++.h>
#include<string.h>
using namespace std;
int main()
{
    char a[110];
    char b[110];
    int n;
    int j;
    int k=0;
    cin>>n;
    getchar();
    while(n--)
    {
        k++;
        j=0;
        gets(a);
        memset(b,0,sizeof(b));
        int len=strlen(a);
        for(int i=len-1;i>=0;i--)
        {
            switch(a[i])
            {
                case '!':b[j++]='i';break;
                case '5':b[j++]='s';break;
                case 'n':b[j++]='u';break;
                case 'a':b[j++]='e';break;
                case 'p':b[j++]='d';break;
                case '7':b[j++]='l';break;
                case '^':b[j++]='v';break;
                case 'w':b[j++]='m';break;
                case 'u':b[j++]='n';break;
                case 'e':b[j++]='a';break;
                case 'o':b[j++]='o';break;
                case ' ':b[j++]=' ';break;
            }
        }
        //for(int i=0;i<len;i++)
        printf("Case %d: %s\n",k,b);
    }
    return 0;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/509452.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

socket阻塞与非阻塞,同步与异步

转自&#xff1a;http://blog.csdn.net/hguisu/article/details/7453390 socket阻塞与非阻塞&#xff0c;同步与异步 作者&#xff1a;huangguisu 1. 概念理解 在进行网络编程时&#xff0c;我们常常见到同步(Sync)/异步(Async)&#xff0c;阻塞(Block)/非阻塞(Unblock)四种调…

网络编程之如何通过URL获取网页代码

java.net 类 URL java.lang.Objectjava.net.URL所有已实现的接口&#xff1a; Serializable public final class URLextends Objectimplements Serializable类 URL 代表一个统一资源定位符&#xff0c;它是指向互联网“资源”的指针。资源可以是简单的文件或目录&#xff0c;…

数据结构实验之图论七:驴友计划

题目描述 做为一个资深驴友&#xff0c;小新有一张珍藏的自驾游线路图&#xff0c;图上详细的标注了全国各个城市之间的高速公路距离和公路收费情况&#xff0c;现在请你编写一个程序&#xff0c;找出一条出发地到目的地之间的最短路径&#xff0c;如果有多条路径最短&#xff…

Windows完成端口(IOCP)

http://blog.csdn.net/piggyxp/article/details/6922277

图结构练习——最小生成树

题目描述 有n个城市&#xff0c;其中有些城市之间可以修建公路&#xff0c;修建不同的公路费用是不同的。现在我们想知道&#xff0c;最少花多少钱修公路可以将所有的城市连在一起&#xff0c;使在任意一城市出发&#xff0c;可以到达其他任意的城市。 输入 输入包含多组数据&a…

Windows 中_T和L

_T("")是一个宏&#xff0c;定义于tchar.h下。[1]&#xfeff; #define _T(x) _ _T(x)   #ifdef _UNICODE #define _ _T(x) L ## x #else /* ndef _UNICODE */ #define _ _T(x) x 他的作用是让你的程序支持Unicode编码 因为Windows使用两种字符集ANSI和UN…

多线程笔记补充之线程通信wait和notify方法以及Lock和Condition接口的使用

线程通信-wait和notify方法介绍: java.lang.Object类提供类两类用于操作线程通信的方法. wait():执行该方法的线程对象释放同步锁,JVM把该线程存放到等待池中,等待其他的线程唤醒该线程. notify:执行该方法的线程唤醒在等待池中等待的任意一个线程,把线程转到锁池中等待. notif…

数据结构实验之图论六:村村通公路

题目描述 当前农村公路建设正如火如荼的展开&#xff0c;某乡镇政府决定实现村村通公路&#xff0c;工程师现有各个村落之间的原始道路统计数据表&#xff0c;表中列出了各村之间可以建设公路的若干条道路的成本&#xff0c;你的任务是根据给出的数据表&#xff0c;求使得每个村…

技术人生“白天求生存,晚上谋发展”

白天求生存&#xff0c;晚上谋发展 这句话最近在团队经常有人说&#xff0c;其实我也深有体会&#xff0c;因为我看到的技术牛人他们背后肯定有一段很长时间的艰苦时光&#xff0c;可能是3年&#xff0c;也可能是8年&#xff0c;也可能一直还在坚持。 其实我们周围大部份人有一…

CRT

当C Runtime函数库于20世纪70年代产生出来时&#xff0c;PC的内存容量还很小,多任务是个新奇观念&#xff0c;更别提什么多线程了。因此以当时产品为基础所演化的C Runtime函数库在多线程&#xff08;multithreaded&#xff09;的表现上有严重问题&#xff0c;无法被多线程程序…

java多线程笔记补充之线程的生命周期

多线程通信的时候很容易造成死锁,死锁无法解决,只能避免: 当A线程等待由B线程持有的锁,而B线程正在等待A线程持有的锁时,发生死锁现象,JVM不检测也不试图避免这种情况,所以程序员必须保证不导致死锁. 避免死锁法则: 当多个线程都要访问共享的资源A,B,C时,保证每一个线程都按照…

图结构练习——BFSDFS——判断可达性

题目描述 在古老的魔兽传说中&#xff0c;有两个军团&#xff0c;一个叫天灾&#xff0c;一个叫近卫。在他们所在的地域&#xff0c;有n个隘口&#xff0c;编号为1..n&#xff0c;某些隘口之间是有通道连接的。其中近卫军团在1号隘口&#xff0c;天灾军团在n号隘口。某一天&…

关于跨dll的模板单例问题

C的模板可以帮助我们编写适合不同类型的模板类&#xff0c;给代码的复用性提供了极大的方便。近来写了一个涉及单例的C模板类&#xff0c;简化下来可以归结为以下的代码&#xff1a; 1234567891011template <typename T>class Singleton{public:// 此处省去了多线程安全锁…

java多线程笔记补充之 线程控制操作

线程休眠:让执行的线程暂停一段时间&#xff0c;进入计时等待状态。 方法:staticvoid sleep(long millis) 调用sleep后&#xff0c;当前线程放弃CPU,在指定时间段之内&#xff0c;sleep所在线程不会获得执行的机会。 此状态下的线程不会释放同步锁/同步监听器. 该方法更多的用…

图结构练习——BFS——从起始点到目标点的最短步数

题目描述 在古老的魔兽传说中&#xff0c;有两个军团&#xff0c;一个叫天灾&#xff0c;一个叫近卫。在他们所在的地域&#xff0c;有n个隘口&#xff0c;编号为1..n&#xff0c;某些隘口之间是有通道连接的。其中近卫军团在1号隘口&#xff0c;天灾军团在n号隘口。某一天&…

C++中的Dll内存问题

这两天在做一个数据结构&#xff0c;使用树结构&#xff0c;两层&#xff0c;第一层的数据元素为第二层的n个分支 遇到问题如下&#xff1a; 1&#xff1a;使用vector在debug下运行正常&#xff0c;在release下源码运行正常封装后运行失败 请教了多人&#xff0c;觉得可能是vec…

Catch That Cow

题目描述 Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,000) on the same number line. Farmer John ha…

java5新特性静态引用、foreach、自动装箱和泛型枚举以及可变参数的总结

静态引用 导入(import)表示去找哪一个类&#xff0c;去哪一个包下去找哪些被使用到的类。 在java中有一个语言核心包&#xff1a;java.lang. 使用java.lang包中的API&#xff0c;不需要引用&#xff0c;直接能找到&#xff0c;但是&#xff0c;如果我们使用到的API不呼吁java.l…

C++中堆和栈的完全解析

C中堆和栈的完全解析 内存分配方面&#xff1a; 堆&#xff1a; 操作系统有一个记录空闲内存地址的链表&#xff0c;当系统收到程序的申请时&#xff0c;会遍历该链表&#xff0c;寻找第一个空间大于所申请空间的堆结点&#xff0c;然后将该结点从空闲结点链表中删 除&#xff…