fork download
  1. #include <iostream>
  2. #include <stdlib.h>
  3. #include <string>
  4. #include<iostream>
  5. using namespace std;
  6.  
  7. int main(){
  8. string s1;
  9. string s2;
  10. string s3;
  11. getline(cin, s1);
  12. getline(cin, s2);
  13. getline(cin, s3);
  14. int i= s1.find(s2);
  15. s1.erase(i, s2.size());
  16. s1.insert(i, s3);
  17. cout<<s1;
  18. return 0;
  19.  
  20. }
  21.  
Success #stdin #stdout 0s 4396KB
stdin
hello my world
my
fucking
stdout
hello fucking world