n a^o7 !
2015-07-30 19:36
471 查看
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
千万不要被这一大串英文给迷惑了,这里面有用的就只有一句 :(only contain 'n5!wpuea^o7!' and
' '(space)),这就是一个简单的字符串处理问题,把字符串倒过来看就可以了
#include<stdio.h>
#include<string.h>
int main()
{
char str[210];
int T,i,j,n;
scanf("%d",&T);
for(i=1;i<=T;i++)
{
if(i==1)
getchar();
gets(str);
n=strlen(str);
for(j=0;j<n;j++)
{
if(str[j]=='n')
str[j]='u';
else if(str[j]=='5')
str[j]='s';
else if(str[j]=='!')
str[j]='i';
else if(str[j]=='w')
str[j]='m';
else if(str[j]=='p')
str[j]='d';
else if(str[j]=='u')
str[j]='n';
else if(str[j]=='e')
str[j]='a';
else if(str[j]=='a')
str[j]='e';
else if(str[j]=='^')
str[j]='v';
else if(str[j]=='7')
str[j]='l';
}
printf("Case %d: ",i);
for(j=n-1;j>=0;j--)
{
printf("%c",str[j]);
}
printf("\n");
}
return 0;
}
相关文章推荐
- 数据库链接字符串查询网站
- Flex字符串比较 还有Flex字符串操作
- Ruby中创建字符串的一些技巧小结
- ASP下经常用的字符串等函数参考资料
- 将字符串小写转大写并延时输出的批处理代码
- 将字符串转换成System.Drawing.Color类型的方法
- Lua和C语言的交互详解
- Lua源码中字符串类型的实现
- Lua性能优化技巧(四):关于字符串
- 字符串聚合函数(去除重复值)
- 总结的5个C#字符串操作方法分享
- sqlserver中求字符串中汉字的个数的sql语句
- sql server字符串非空判断实现方法
- VBS的字符串及日期操作相关函数
- C#实现将千分位字符串转换成数字的方法
- jquery 删除字符串最后一个字符的方法解析
- PowerShell实现在字符串中查找大写字母
- PowerShell中使用Out-String命令把对象转换成字符串输出的例子
- PowerShell中字符串使用单引号和双引号的区别
- Powershell小技巧之获取字符串的行数