The Marshtomp has seen it all before
来源:互联网 发布:阿里云 outllok 编辑:程序博客网 时间:2024/06/08 09:10
fjxmlhx不喜欢网上的 marshtomps 。所以他决定把所有的 “marshtomp”(名字不区分大小写) 改为 “fjxmlhx;
Input
输入包含多行,每行字符串不超过200的长度,一个单词不会一半出现在上一行,剩下的在下一行。直到文件结束(EOF)
Output
输出 替换之后的字符串。
Sample Input
The Marshtomp has seen it all before.
marshTomp is beaten by fjxmlhx!
AmarshtompB
Sample Output
The fjxmlhx has seen it all before.
fjxmlhx is beaten by fjxmlhx!
Input
输入包含多行,每行字符串不超过200的长度,一个单词不会一半出现在上一行,剩下的在下一行。直到文件结束(EOF)
Output
输出 替换之后的字符串。
Sample Input
The Marshtomp has seen it all before.
marshTomp is beaten by fjxmlhx!
AmarshtompB
Sample Output
The fjxmlhx has seen it all before.
fjxmlhx is beaten by fjxmlhx!
AfjxmlhxB
代码:
#include<stdio.h>#include<string.h>using namespace std;char s[230];int Is(char ch){ //判断字符类型(大写字母,小写字母,非字母) if(ch>='a'&&ch<='z') return 1; else if(ch>='A'&&ch<='Z') return 2; return 0;}int Strcmp(int a){ //与"marshtomp"进行匹配 char op[10]="marshtomp"; int i=a,j=0; for(j=0;j<10;i++,j++){ if(Is(s[i])==0) break; else if(Is(s[i])==1&&s[i]!=op[j]) break; else if(Is(s[i])==2&&s[i]-'A'+'a'!=op[j]) break; } if(j<9) return 0; return 1;}int main(){ while(gets(s)!=NULL){ //gets()返回类型为指针 int len=strlen(s); int i; for(i=0;i<len;i++){ if(Strcmp(i)){ printf("fjxmlhx"); i+=8; } else{ printf("%c",s[i]); } } printf("\n"); }return 0;}
阅读全文
0 0
- The Marshtomp has seen it all before
- The Marshtomp has seen it all before
- # hihocoder #1082 : The Marshtomp has seen it all before
- E - The Marshtomp has seen it all before
- The Marshtomp has seen it all before(c/c++字符串输入处理)
- Analyzing Linux kernel crash dumps with crash - The one tutorial that has it all
- Analyzing Linux kernel crash dumps with crash - The one tutorial that has it all
- The maximum recursion 100 has been exhausted before statement completion
- It is All About The Data
- It's All In The Mind
- hdu5742 It's All In The Mind
- 5742 ( It's All In The Mind )
- HDU5742 It's All In The Mind
- hdu5742 It's All In The Mind
- hdoj5742 It's All In The Mind
- It's All In The Mind
- It's All In The Mind HDU
- This is it——Hasn't see it before all
- 阿里云主机配置
- 开发工具
- XSS攻击及防御
- 绑定时间
- Json文件的解析
- The Marshtomp has seen it all before
- Python爬虫---爬取静态网页的图片
- Iris DataSet 鸢尾花数据集
- 精通正则表达式六:匹配优先与忽略优先
- 2017第十六届亚洲(北京)国际进口食品暨高端食品饮料展览会会刊(参展商名录)
- Windows7 下python3和python2同时 安装python3和python2
- ABP从入门到精通(6):快速重命名解决方案
- jdb
- Angular最新教程-第二节使用git、svn和码云做版本控制