Advertisement
STANAANDREY

sb prog 18

Feb 25th, 2022
1,212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <cstring>
  2. #include <stdio.h>
  3. using namespace std;
  4. #define VOWELS "aeiou"
  5.  
  6. int main() {
  7.     char s[1001];
  8.     gets(s);
  9.     int n = strlen(s);
  10.  
  11.     for (int i = 0; i < n; i++) {
  12.         if (strchr(VOWELS, s[i]) != NULL) {
  13.             strcpy(s + i + 3, s + i + 1);
  14.             s[i + 1] = 'p';
  15.             s[i + 2] = s[i];
  16.             n += 2;
  17.             s[n] = '\0';
  18.         }
  19.     }
  20.  
  21.     puts(s);
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement