Advertisement
ninepintcoggie

Untitled

Feb 26th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <iomanip>
  4. #include <algorithm>
  5.  
  6.  
  7. using namespace std;
  8.  
  9. int main ()
  10. {
  11. string pattern, replacement, x;
  12. cout << "Pattern?" << endl;
  13. getline(cin, pattern);
  14. cout << "Replacement?" << endl;
  15. getline(cin, replacement);
  16. //while (((x[x.length() - 1] != "$") && ((x[x.length()] != "$"))
  17. while (x != "$$")
  18. {
  19. cout << "Input?" << endl;
  20. getline(cin, x);
  21. if (x.find(pattern) >= 0)
  22. {
  23. x.replace(x.find(pattern), pattern.length(), "");
  24. cout << x << endl;
  25. }
  26. // cout << pattern << "*******************" << endl;
  27. }
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement