Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- cout<<"Введите строку: "<<endl;
- string str;
- cin>>str;
- cout<<"Что удалять?"<<endl;
- string del;
- cin>>del;
- string::size_type pos = str.find(del);
- while (pos != string::npos)
- {
- str.erase(pos, del.size());
- pos = str.find(del, pos + 1);
- }
- cout<<"Вот результат: ";
- cout<<str<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement