Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- char double_a(char string[])
- {
- for (int i = 0; i < strlen(string); i++)
- {
- if (string[i] == 'a')
- {
- for (int j = strlen(string); j > i + 1; j--)
- {
- string[j] = string[j - 1];
- }
- string[i + 1] = 'a';
- }
- }
- //Needs to return an actual string, but I'm too lazy to finish it off
- }
- int main()
- {
- char base[20] = "Yoona eats flowers";
- double_a(base);
- cout << base;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement