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)

示例输入

2
n 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

提示

 

来源

 2012年"浪潮杯"山东省第三届ACM大学生程序设计竞赛

 
  水题
  因为只会出现“n5!wpuea^o7!”这些字符,所以依次单独处理即可。
  代码:
 #include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
void work(char a[])
{
int i;
for(i=;a[i];i++){
switch(a[i]){
case 'n':a[i]='u';break;
case '':a[i]='s';break;
case 'w':a[i]='m';break;
case 'p':a[i]='d';break;
case 'u':a[i]='n';break;
case 'e':a[i]='a';break;
case 'a':a[i]='e';break;
case '^':a[i]='v';break;
case 'o':a[i]='o';break;
case '':a[i]='l';break;
case '!':a[i]='i';break;
default:break;
}
}
}
int main()
{
int n,cnt = ;
cin>>n;
getchar();
while(n--){
char a[];
cin.getline(a,,'\n');
work(a);
cout<<"Case "<<cnt++<<": ";
int len = strlen(a)-;
for(;len>=;len--)
cout<<a[len];
cout<<endl;
}
return ;
} /**************************************
Problem id : SDUT OJ D
User name : Miracle
Result : Accepted
Take Memory : 472K
Take Time : 0MS
Submit Time : 2014-04-27 09:16:04
**************************************/

Freecode : www.cnblogs.com/yym2013

sdut 2413:n a^o7 !(第三届山东省省赛原题,水题,字符串处理)的更多相关文章

  1. sdut 2411:Pixel density(第三届山东省省赛原题,字符串处理)

    Pixel density Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Pixels per inch (PPI) or pi ...

  2. sdut 2163:Identifiers(第二届山东省省赛原题,水题)

    Identifiers Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述  Identifier is an important c ...

  3. sdut 2154:Shopping(第一届山东省省赛原题,水题)

    Shopping Time Limit: 1000MS Memory limit: 65536K 题目描述 Saya and Kudo go shopping together.You can ass ...

  4. sdut 2416:Fruit Ninja II(第三届山东省省赛原题,数学题)

    Fruit Ninja II Time Limit: 5000MS Memory limit: 65536K 题目描述 Have you ever played a popular game name ...

  5. sdut 2610:Boring Counting(第四届山东省省赛原题,划分树 + 二分)

    Boring Counting Time Limit: 3000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述     In this problem you a ...

  6. sdut 2153:Clockwise(第一届山东省省赛原题,计算几何+DP)

    Clockwise Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Saya have a long necklace with ...

  7. sdut 2152:Balloons(第一届山东省省赛原题,DFS搜索)

    Balloons Time Limit: 1000MS Memory limit: 65536K 题目描述 Both Saya and Kudo like balloons. One day, the ...

  8. sdut 2603:Rescue The Princess(第四届山东省省赛原题,计算几何,向量旋转 + 向量交点)

    Rescue The Princess Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Several days ago, a b ...

  9. sdut 2162:The Android University ACM Team Selection Contest(第二届山东省省赛原题,模拟题)

    The Android University ACM Team Selection Contest Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里 ...

随机推荐

  1. java 小记

    1.获取web项目根目录的绝对路径 request.getContextPath()  获取项目名称,如    /BiYeSheJi getServletContext().getRealPath(& ...

  2. C# Attribute 特性 学习

    一.特性的概述 公共语言运行库允许您添加类似关键字的描述性声明(称为特性 (Attribute))来批注编程元素,如类型.字段.方法和属性 (Property).属性与 Microsoft .NET ...

  3. IOS学习笔记—苹果推送机制APNs

    转自:唐韧_Ryan http://blog.csdn.net/ryantang03/article/details/8482259 推送是解决轮询所造成的流量消耗和 电量消耗的一个比较好的解决方案, ...

  4. java常见异常类图(分类了Error/RuntimeExecption、check Exception)

    版权:欧初权 http://www.cnblogs.com/langtianya/p/4435537.html

  5. java.net.SocketException:Software caused connection abort: recv failed 异常分析 +socket客户端&服务端代码

    java.net.SocketException:Software caused connection abort: recv failed 异常分析 分类: 很多的技术 2012-01-04 12: ...

  6. Linux 解压命令tar的理解

    今天回顾了下tar 这个打包工具的一些常用参数 选项与参数: -c :创建打包文件,可搭配 -v 来察看过程中被打包的档名(filename) -t :察看打包文件的内容含有哪些档名,重点在察看『档名 ...

  7. 几款web开发常用jquery特效代码

    特效网:http://www.xwcms.net  1.图片拖动特效http://www.xwcms.net/js/tpdm/32946.html2.弹出层焦点图特效:http://www.xwcms ...

  8. js实现把网页table导成Excel

    //导出excel function exportExcel(DivID,strTitle){ if(DivID==null) { return false; } var jXls, myWorkbo ...

  9. OpenSwitch操作系统成为Linux基金会官方项目

    导读 非盈利机构Linux基金会为推进Linux和开源软件在企业和专业人士的发展,于今天宣布OpenSwitch项目成为Linux基金会官方项目之一. Linux基金会的常务董事Jim Zemlin表 ...

  10. Can't connect to local MySQL Server throught socket '/var/run/mysqld/mysqld.sock'(2)

    www.iwangzheng.com 由于之前调整了/etc/mysql/my.cnf试图修复数据库不能存中文的问题,这个问题没解决,以至于数据库连接不上了. tail -f /var/log/mys ...