fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string x = "WUBWEWUBAREWUBWUBTHEWUBCHAMPIONSWUBMYWUBFRIENDWUB";
  7. string s;
  8. for(int i=0; i<x.size(); i++)
  9. {
  10. if (x.find("WUB") != string::npos)
  11. s = x.erase(x.find("WUB"),3);
  12. }
  13. cout<<s;
  14. return 0;
  15. }
Success #stdin #stdout 0s 3228KB
stdin
Standard input is empty
stdout
WEARETHECHAMPIONSMYFRIEND