Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <iomanip>
- #include <algorithm>
- using namespace std;
- int main ()
- {
- string pattern, replacement, x;
- cout << "Pattern?" << endl;
- getline(cin, pattern);
- cout << "Replacement?" << endl;
- getline(cin, replacement);
- //while (((x[x.length() - 1] != "$") && ((x[x.length()] != "$"))
- while (x != "$$")
- {
- cout << "Input?" << endl;
- getline(cin, x);
- if (x.find(pattern) >= 0)
- {
- x.replace(x.find(pattern), pattern.length(), "");
- cout << x << endl;
- }
- // cout << pattern << "*******************" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement