小王想要编写一个实现文字查找替换功能的C++程序,输入原文、待查找内容和替换内容,输出查找替换的结果,和替换的次数。
第一行输入一个字符串,表示原文,长度不超过255,由英文字母、标点符号等组成。
第二行输入一个单词,表示查找单词,长度不超过20,由英文字母组成。
第三行输入一个单词,表示替换单词,长度不超过20,由英文字母组成。
第一行输出查找替换后的结果。第二行输出一个整数,表示替换的次数。
My father was a self-taught mandolin player. He was one of the best string instrument players in our town.
was
is
My father is a self-taught mandolin player. He is one of the best string instrument players in our town.
2