nikolas_serafini

Lista 4 - Exercício 35

Jun 25th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6.     int i,counter = 0;
  7.     char text[200];
  8.  
  9.     printf("Entre com um texto :\n");
  10.     gets(text);
  11.     for (i = 0; i < strlen(text); i++)
  12.     {
  13.         if (text[i] == 'a' || text[i] == 'e' || text[i] == 'i' || text[i] == 'o' || text[i] == 'u')
  14.             if (text[i+1] == 'a' || text[i+1] == 'e' || text[i+1] == 'i' || text[i+1] == 'o' || text[i+1] == 'u')
  15.             {
  16.                 counter++;
  17.             }
  18.     }
  19.     printf("Texto possui %d ocorrencias de vogais juntas.\n",counter);
  20.    
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment