题目:

刚哥遇到了感情问题(二)

时间限制: 1000 ms  |  内存限制: 65535 KB
难度: 1
描述

上一集我们讲到 作为工作室老大的刚哥遇到很多女生的追求,你帮他个挑选了个英语成绩不错的对象。在你的帮助下,刚哥找到了个    英语学霸村    的小花,刚哥对小花的追求并不是那么一帆风顺。

事情是这样的:为了追求小花,刚哥打算给小花写点情书,然而小花却要求刚哥用英文给她写情书,并且要求刚哥不许使用百度翻译,这可难为刚哥了,刚哥自幼就爱国,对西洋文不怎么感冒,幸得健爷的帮助,刚哥成功把中文的情书翻译成了英文的情书,然而问题来了,刚哥写的情书太肉麻,健爷决定把   miss  love  kiss  这三个单词替换成  apple  banana  orange  ,眼看着今晚就要约会了,没有这些肉麻的词,刚哥约会时会不自在的.

你能在今晚10点前帮刚哥把信里面出现这三个单词的地方合理地用  miss  love  kiss  替换吗?刚哥都快急哭了,你就帮帮他吧  O(∩_∩)O~

输入
多组输入

一次输入多行

情书以 thas all 结束
程序 读到文档结束。

输出
帮刚哥把信里面出现这三个单词的地方合理地用 miss love kiss 替换, 原格式输出。
样例输入
Dear Mine: Just for one reason, I banana you so much. Nothing is impossible to a willing mind, banana included. Therefore, day after day, I wonder why, I wonder how, I wonder where you are. Time to go, I want to tell you how much I feel, and how much I banana you. When I think of you, the miles between us disappear. Seeing you will cause me an indescribable thrill, even at the sight of your handwriting will make me tremble. And the wonderful times we shared together shall always remain in my heart. You are my little angel. Just having you close fills me with banana and hope; nothing is impossible by your side. It is only when I nearly lose you that I become fully conscious of how much I value you. Accordingly, I would say, "I banana you" for millions and billions of times, and times and times again. Everything comes and goes, but banana stays. When you need someone, remember that I'd be there. If I were in heaven, I'd write your name on every star for all to see just how much you mean to me. No matter how long the road may be in the future, please cherish every moment we shared together. No matter how many years will pass away, please treasure our banana till the last day. banana is the triumph of imagination over intelligence.thas alli apple youi banana youi orange youthas all
样例输出
Dear Mine: Just for one reason, I love you so much. Nothing is impossible to a willing mind, love included. Therefore, day after day, I wonder why, I wonder how, I wonder where you are. Time to go, I want to tell you how much I feel, and how much I love you. When I think of you, the miles between us disappear. Seeing you will cause me an indescribable thrill, even at the sight of your handwriting will make me tremble. And the wonderful times we shared together shall always remain in my heart. You are my little angel. Just having you close fills me with love and hope; nothing is impossible by your side. It is only when I nearly lose you that I become fully conscious of how much I value you. Accordingly, I would say, "I love you" for millions and billions of times, and times and times again. Everything comes and goes, but love stays. When you need someone, remember that I'd be there. If I were in heaven, I'd write your name on every star for all to see just how much you mean to me. No matter how long the road may be in the future, please cherish every moment we shared together. No matter how many years will pass away, please treasure our love till the last day. love is the triumph of imagination over intelligence.thas alli miss youi love youi kiss youthas all
来源
自创
上传者
1483523635

思路:

简单的字符串处理,当年刷水题时遗留下来的。。。

代码:

#include <cstdio>
#include <cstring>
#include <cctype>
#include <string>
#include <set>
#include <iostream>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <algorithm>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
#define N 100000+20
#define mod 10007
#define M 1000000+10
#define ll long long
using namespace std;
int main()
{string a;const ll zz=4294967295;while(getline(cin,a)){while(1){ll apple=a.find("apple");if(apple!=zz)a.replace(apple,5,"miss");elsebreak;}while(1){ll banana=a.find("banana");if(banana!=zz)a.replace(banana,6,"love");elsebreak;}while(1){ll orange=a.find("orange");if(orange!=zz)a.replace(orange,6,"kiss");elsebreak;}cout<<a<<endl;}return 0;
}

NYOJ1294 刚哥遇到了感情问题(二)(字符串处理)相关推荐

  1. 音频文件 数据库存储_刚哥谈架构 (六) 谈谈数据库架构

    无论是构建什么样的应用,大都离不开数据.而在应用的架构设计中,如何设计数据库,使用什么类型的数据库,就是一个架构师必须了解的.所有的数据库的共同点都是以某种方式存储数据,以某种接口来访问存储的数据.我 ...

  2. 刚哥谈架构 (五)- 推荐给架构师的书单

    刚哥谈架构 (五)- 推荐给架构师的书单 今天收到豆瓣的2019年的总结,发现自己已经在豆瓣渡过10个春秋.今年读了69本书,有很多书非常棒.今天我就给各位架构师,程序员,码农推荐一些我觉得对工作和职 ...

  3. C++字符串完全指引之二 —— 字符串封装类

    C++字符串完全指引之二 -- 字符串封装类 原著:Michael Dunn 作者:Chengjie Sun 原文出处:CodeProject:The Complete Guide to C++ St ...

  4. Pthon.习题二 字符串的基本处理

    Pthon.习题二 字符串的基本处理 1.给定一个字符串"www.moe.gov.cn",编写程序,实现如下功能. (1)输出第一个字符 (2)输出前三个字符 (3)输出后三个字符 ...

  5. 鸟哥私房菜学习(二)Linux是什么与如何学习

    Linux是什么与如何学习 一.Linux是什么 二.Linux的背景和历史 三.托瓦兹与LInux的发展 Linux虚拟团队的产生和发展 Linux的内核版本 Linux发行版本 四.Linux当前 ...

  6. 跟着刚哥梳理java知识点——多线程(十六)

    创建多线程 第一种方式: ① 继承:继承Thread. ② 重写:重写Thread类的run()方法 ③ 创建:创建一个子类的对象 ④ 调用:调用线程的start()方法,启动此线程,调用run()方 ...

  7. 跟着鬼哥学so改动,二,进行篇

    图/文  听鬼哥说故事 继续上文的内容---------------------------------- 0x1:測试文件的编写 经过上一篇文章的基础学习,如今我们開始进行是用的部分. 既然我们能够 ...

  8. 万哥的数据库笔记(二)关系数据结构及形式化定义

    第二章 关系数据库 2.1 关系数据结构及形式化定义 2.1.1 关系 **域:**一组具有相同数据类型的值的集合 **笛卡尔积:**域上的一种集合运算 D1=导师集合SUPERVISOR={张清玫, ...

  9. python十二:字符串格式化

    # python的字符串格式化有两种: 百分号方式,format方式 s = "Hello %s, Hello %s" % ("world", "py ...

  10. Java char jdk_java学习系列之二---字符串(char.String.StringBuilder以及StringBuffer)

    一.String 1.String:字符串常量,字符串长度不可变.Java中String是immutable(不可变)的.String类是被final修饰 2.String str="hel ...

最新文章

  1. HashSet中的add()方法( 五 )(详尽版)
  2. Linux内核学习的一些国外网站
  3. 一个ioc例子jdk和spring版本导致问题
  4. 转 CentOS下php安装mcrypt扩展
  5. JavaScript 的性能优化:加载和执行
  6. 好好学一遍JavaScript 笔记(一)
  7. 监听浏览器是否被缩放 - 案例篇
  8. python写飞机大战游戏_python实现飞机大战游戏
  9. [Ubuntu] ubuntu20.04 安装 Mendeley
  10. 低代码和零代码火了,十大利器推荐!
  11. 螃蟹保存方法保存时间_中秋吃不完的螃蟹如何保存?蟹农:生螃蟹冰箱冷藏,熟螃蟹别隔夜...
  12. Thymeleaf无法显示css样式
  13. 在线广告系统的架构变迁
  14. 新技术计算机的案例,计算机新技术
  15. 后台界面也可以很酷!31个高大上的后台管理系统模版
  16. Unity3D教程(一)安装以及使用Unity3D
  17. 学会这些,不做委屈的项目经理
  18. Vue 链接生成二维码
  19. Bayes,HMM,MRF Gibbs Distribution在图像降噪中的应用
  20. NIPS最佳,惊人的天赋与无人察觉的缺陷并存,GPT-3的未来有多少种可能......

热门文章

  1. Python获取秒级时间戳与毫秒级时间戳以及python中时间、日期、时间戳的转换
  2. 【微信小程序开发】第 7 课 - 小程序的常用组件
  3. Android中从设置界面退出登录,回到主界面或者回到登陆界面
  4. 哪款蓝牙耳机性价比高?高性价比的四款蓝牙耳机推荐
  5. 智能手表音频特性测试_“微纳结构动态特性测试仪”国家重大专项荣获舜宇智能光学2019年度优秀项目奖...
  6. day1:【软中信安知识学习】
  7. mysql bet,第一阶段Mysql总结
  8. CIT_DM and ML_lecture 1
  9. 如何识别手写汉字?这些强大的软件可以帮助你
  10. Java设计模式_(行为型)_责任链模式