Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- setlocale(LC_ALL, "ru");
- string text = "abracadabra";
- string str = "ab";
- int last = text.find(str);
- int longevity = str.size() + 1;
- while (last != string::npos) {
- text.insert(last, "(");
- text.insert(last + longevity, ")");
- last = text.find(str, last + longevity);
- }
- cout << text << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement