Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <conio.h>
- #include <string>
- #include <stdio.h>
- #include <stdlib.h>
- #include <clocale>
- using namespace std;
- int main() {
- setlocale(LC_ALL, "rus");
- char str1[100];
- cout << ("Введите строку: ");
- int l = 100;
- cin.getline(str1, l);
- for (int i = 0, k = 0; i < strlen(str1); i++) {
- if (str1[i] == 'a')
- {
- for (int j = strlen(str1) + 1; j>i; j--){
- str1[j] = str1[j - 1];
- }
- str1[i + 1] = 'b';
- }
- }
- puts(str1);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement