时间限制:1000ms
单点时限:1000ms
内存限制:256MB

描述

fjxmlhx每天都在被沼跃鱼刷屏,因此他急切的找到了你希望你写一个程序屏蔽所有句子中的沼跃鱼(“marshtomp”,不区分大小写)。为了使句子不缺少成分,统一换成 “fjxmlhx” 。

输入

输入包括多行。

每行是一个字符串,长度不超过200。

一行的末尾与下一行的开头没有关系。

输出

输出包含多行,为输入按照描述中变换的结果。

样例输入
The Marshtomp has seen it all before.
marshTomp is beaten by fjxmlhx!
AmarshtompB
样例输出
The fjxmlhx has seen it all before.
fjxmlhx is beaten by fjxmlhx!
AfjxmlhxB
 #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
char s[];
int main(){
while(gets(s)){
int len = strlen(s);
for(int i = ; s[i] != '\0'; i++){
if((s[i] == 'M' || s[i] == 'm') && (s[i + ] == 'A' || s[i + ] == 'a')
&& (s[i + ] == 'R' || s[i + ] == 'r') && (s[i + ] == 'S' || s[i + ] == 's')
&& (s[i + ] == 'H' || s[i + ] == 'h') && (s[i + ] == 'T' || s[i + ] == 't')
&& (s[i + ] == 'O' || s[i + ] == 'o') && (s[i + ] == 'M' || s[i + ] == 'm')
&& (s[i + ] == 'P' || s[i + ] == 'p')){
printf("fjxmlhx");
i += ;
} else {
//printf("%c", s[i]);
putchar(s[i]);
}
}
cout << endl;
}
return ;
}
 

hihocoder 1082 然而沼跃鱼早就看穿了一切(字符串替换)的更多相关文章

  1. hihoCoder #1082 : 然而沼跃鱼早就看穿了一切(字符串处理)

    #1082 : 然而沼跃鱼早就看穿了一切 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 fjxmlhx每天都在被沼跃鱼刷屏,因此他急切的找到了你希望你写一个程序屏蔽所有句 ...

  2. hihoCoder - 1082 - 然而沼跃鱼早就看穿了一切 (字符串处理!!)

    #1082 : 然而沼跃鱼早就看穿了一切 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描写叙述 fjxmlhx每天都在被沼跃鱼刷屏,因此他急切的找到了你希望你写一个程序屏蔽全 ...

  3. hihocoder 1082 然而沼跃鱼早就看穿了一切 (替换指定的串 )

    #1082 : 然而沼跃鱼早就看穿了一切 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 fjxmlhx每天都在被沼跃鱼刷屏,因此他急切的找到了你希望你写一个程序屏蔽所有句 ...

  4. Hihocoder #1082 : 然而沼跃鱼早就看穿了一切 暴力

    时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 fjxmlhx每天都在被沼跃鱼刷屏,因此他急切的找到了你希望你写一个程序屏蔽所有句子中的沼跃鱼(“marshtomp”,不区 ...

  5. hihocoder:#1082 : 然而沼跃鱼早就看穿了一切(用string)

    题目是这样的: 描述 fjxmlhx每天都在被沼跃鱼刷屏,因此他急切的找到了你希望你写一个程序屏蔽所有句子中的沼跃鱼("marshtomp",不区分大小写).为了使句子不缺少成分, ...

  6. hihoCoder 1082然而沼跃鱼早就看穿了一切 (字符串处理)

    http://hihocoder.com/problemset/problem/1082 首先将字符串全部字母变成小写,不断用find查找字符串中的Marshtomp,并把每个字符变为’#‘ ,最后统 ...

  7. hihoCoder#1082 然而沼跃鱼早就看穿了一切

    原题地址 字符串匹配+替换 注意替换串和原串长度是不等的,所以替换完还要进行收缩 可以顺带练习一下KMP 代码: #include <iostream> #include <cstr ...

  8. 【hihoCoder】1082: 然而沼跃鱼早就看穿了一切

      题目:http://hihocoder.com/problemset/problem/1082 输入一个字符串,将其中特定的单词替换成另一个单词   代码注意点: 1. getline(istre ...

  9. 【面试笔试算法】Problem 8: 然而沼跃鱼早就看穿了一切(hiho题库)

    时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 fjxmlhx每天都在被沼跃鱼刷屏,因此他急切的找到了你希望你写一个程序屏蔽所有句子中的沼跃鱼("marshtom ...

随机推荐

  1. .NET开发中的事务处理大比拼

    本文转载:http://www.cnblogs.com/jhxk/articles/2696307.html http://liubaolongg.blog.163.com/blog/static/2 ...

  2. Segger RTT : Real Time Terminal SRAM 调试解决方法

    http://segger.com/jlink-real-time-terminal.html Real Time Terminal SEGGER's Real Time Terminal (RTT) ...

  3. How to get cocoapods work on Yosemite

    查看原文:http://leancodingnow.com/how-to-get-cocoapods-work-on-yosemite/ 今天升级了Mac OS X 10.10-Yosemite以后运 ...

  4. 学习马士兵的struts2/hibernate/spring中遇到的问题及其解决方法

    STRUTS2 1. 写好最简单的hello world项目后,无法通过浏览器访问到hello.jsp页面,提示没有资源. 学习structs2的时间,已经更新到了2.3.16了,structs中的很 ...

  5. UVALive 4221 Walk in the Park 扫描线

    Walk in the Park 题目连接: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemi ...

  6. PrettyProgressBar

    https://github.com/liuguangqiang/PrettyProgressBar

  7. ProgressCircular

    https://github.com/eltld/ProgressCircular

  8. oc-25-id类型

    /** id:万能指针 能够指向任何OC对象. id = NSObject *, id cat = [Cat new]; [cat jump]; NSObject:是所有类的父类,基类.可以指向任何O ...

  9. Sharepoint 列表ItemAdding事件判断文件类型、获取当前上传的文件

    using System; using System.Security.Permissions; using Microsoft.SharePoint; using Microsoft.SharePo ...

  10. Linux下判断cpu物理个数、几核

    自己服务器的输出 1. 查看物理CPU的个数   #cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l    1 2. 查 ...