Advertisement
MouseyN1

Dublarea vocalelor din fraza

Feb 24th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. //dublarea vocalelor din fraza
  2.  
  3. #include <iostream>
  4. #include <cstring>
  5. using namespace std;
  6. int main()
  7. {
  8.     char s[101];
  9.     int i, j;
  10.     cin.getline(s, 101);
  11.     int n = strlen(s);
  12.     for(i = 0; i < n; i++)
  13.     {
  14.         if(strchr("aeiou",s[i]))
  15.         {
  16.             n++;
  17.             for(j = n-1; j >= i; j--)
  18.                 s[j+1] = s[j];
  19.             i++;
  20.         }
  21.     }
  22.     s[n] = '\0';
  23.     cout << s;
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement