编写程序将行英文中指定的字符串替换为另一字符串后输出。注意:查找指定字符串时,大小写无关,而且有可能多次出现。
[输入形式]
先从标准输入中分行输入两个英文字符串(每个字符串不为空,长度不超过20,且字符串中不会出现空格),分别表示被替换的字符串和替换成的字符串,然后在下一行输入一行英文(长度不超过200) ,行未有回车换行。
[输出形式]
将输入的英文按指定字符串替换后输出到标准输出上,末尾应有个回车换行。
样例输入]
th
Hello
This second edition of'The C Programming Language describes C
as defined by the ANSI standard. Moder compilers already supportmost features of the standard.
[样例输出]
Hellois second edition of"Helle C Programming Language" describes C as defined by Helloe ANSI standard. Modern compilers alreadysupport most features of Helloe standard.
[样例说明]
样例中输入的被替换的字符串为th,由于是大小写无关查找替换,所以下一行英文信息中有四个子串要替换:Th、Th. th和th,分别替换为Hello,其它信息原样输出。
[评分标准]该题要求编程实现指定字符串的大小写无关查找替换,提交程序文件名为exam2.cexam2 cpp.