Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <sstream>
- using namespace std;
- int main()
- {
- cout << "Enter text: " << endl;
- string text;
- getline(cin, text);
- int a = text.size();
- for (int i = 0; i <a ; i++) {
- if (text[i] == 'k' || text[i] == 'l') {
- for (int j = i; j < a; j++)
- {
- if (text[j + 1] == 'k' || text[j + 1] == 'l' || text[j + 1] == 'm') {
- cout << endl;
- break;
- }
- text[j-i] = text[i+1];
- cout << text[j+1];
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment