Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. cout<<"Введите строку: "<<endl;
  8. string str;
  9. cin>>str;
  10. cout<<"Что удалять?"<<endl;
  11. string del;
  12. cin>>del;
  13. string::size_type pos = str.find(del);
  14. while (pos != string::npos)
  15. {
  16. str.erase(pos, del.size());
  17. pos = str.find(del, pos + 1);
  18. }
  19. cout<<"Вот результат: ";
  20. cout<<str<<endl;
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement