Advertisement
Morass

Replace

Jan 23rd, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. string T,P,H;
  4. int main(void){
  5.     cin>>T>>P>>H;
  6.     while(~T.find(P))
  7.         T=T.substr(0,T.find(P))+H+T.substr(T.find(P)+P.size());
  8.     cout<<T<<endl;
  9.     return 0;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement