fork download
  1. #include <iostream>
  2. #include<string>
  3. using namespace std;
  4.  
  5. // To execute C++, please define "int main()"
  6. int main() {
  7.  
  8. string str="Is it appropriate ans to your problem? : by queryhome",key="ho";
  9. // cin>>str>>key;
  10. size_t i = 0;
  11. while (true) {
  12. i = str.find(key, i);
  13. if (i== std:: string ::npos)
  14. {
  15. break;
  16. }
  17. str.replace(i, key.length(),"");
  18. i += 1;
  19. }
  20. cout<<str<<endl;
  21. return 0;
  22. }
Success #stdin #stdout 0s 3468KB
stdin
how are yow?
ow
stdout
Is it appropriate ans to your problem? : by queryme