Advertisement
weldisalves

Lista 04 - exercício 35

Jun 22nd, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.78 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #define MAX 10000
  4.  
  5. //35. Dado um texto de entrada, verifique quantas vezes aparecem ocorrências de duas vogais juntas.
  6.  
  7. int main()
  8. {
  9.     char texto[MAX];
  10.     int i,cont=0;
  11.  
  12.     printf("\n Digite o texto: \n");
  13.     fgets(texto,MAX,stdin);
  14.  
  15.     for(i=0;i<strlen(texto);i++)
  16.     {
  17.         if((texto[i]=='a'||texto[i]=='e'||texto[i]=='i'||texto[i]=='o'||texto[i]=='u'||texto[i]=='A'||texto[i]=='E'||texto[i]=='I'||texto[i]=='O'||texto[i]=='U')&&(texto[i+1]=='a'||texto[i+1]=='e'||texto[i+1]=='i'||texto[i+1]=='o'||texto[i+1]=='u'||texto[i]=='A'||texto[i]=='E'||texto[i]=='I'||texto[i]=='O'||texto[i]=='U'))
  18.         {
  19.             cont++;
  20.         }
  21.     }
  22.  
  23.     printf("\n Ocorrencia de vogais juntas: %d",cont);
  24.     getchar();
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement