题库练习 敏感词替换

A71714 | 敏感词替换

来源编程题
时间限制1s
内存限制512MB
通过 / 提交0/0

题目描述

在某个论坛上,管理员希望将所有出现的敏感词 bad 替换为 ***,以保证内容的健康。

你的任务是编写一个程序,将输入字符串中的所有 bad 替换为 ***

请注意:替换 bad 过程不区分大小写,也就是说,发言中的 BadBADbaD \dots 均会被替换。

但含有 bad 的单词不会被替换,比如 badgebadminton

输入格式

一个以 . 结尾的字符串 S,表示论坛上的发言(字符串 S 的长度在 [1, 1000] 的范围内,字符串由英文的大小写字母、空格和英文的句号组成)。

输出格式

输出替换后的结果。

输入输出样例

输入 #1
This is a bad example of a bad word.
输出 #1
This is a *** example of a *** word.
输入 #2
Despite feeling bad after the long day, she decided to play badminton to clear her mind.
输出 #2
Despite feeling *** after the long day, she decided to play badminton to clear her mind.
输入 #3
Excuse me where is the Bad desk the BAD desk may not exist.
输出 #3
Excuse me where is the *** desk the *** desk may not exist.
C++ 编辑器
输入
输出