voltage

strings_1411

Nov 14th, 2012
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.67 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6.   const char* vowels = "aeiouy";
  7.   char text[1024], *word, go;
  8.   int tmp;
  9.  
  10.   word = text;
  11.   while(1)
  12.   {
  13.     scanf("%s", word);
  14.     go = !strchr(word, '.');
  15.     if((tmp = strcspn(word, vowels)) != strlen(word))
  16.     {
  17.       word += tmp;
  18.       word++;
  19.       while(1)
  20.       {
  21.         if((tmp = strcspn(word, vowels)) == strlen(word))
  22.         {
  23.           break;
  24.         }
  25.         word += tmp;
  26.         *word = 'u';
  27.         word++;
  28.       }
  29.     }
  30.     word += strlen(word);
  31.     if(!go)
  32.     {
  33.       break;
  34.     }
  35.     *word = ' ';
  36.     word++;
  37.   }
  38.   *word = '\0';
  39.  
  40.   printf("%s\n", text);
  41.  
  42.   return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment