Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string str, oldStr, newStr;
- getline(cin, str);
- getline(cin, oldStr);
- getline(cin, newStr);
- while (str.find(oldStr) != -1) {
- str.replace(str.find(oldStr), oldStr.length(), newStr);
- }
- cout << str << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement