Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. bool vocala(char L)
  6. {
  7.     if(strchr("aeiou" , L))
  8.         return true;
  9.     return false;
  10. }
  11.  
  12. bool consoana(char L)
  13. {
  14.     if(L >= 'a' && L <= 'z' && !vocala(L))
  15.         return true;
  16.     return false;
  17. }
  18.  
  19. int main()
  20. {
  21.     char s[256];
  22.     cin.getline(s, 256);
  23.     int cnt = 0;
  24.     for(int i = 1 ; i < strlen(s) - 1 ; i ++)
  25.         if(consoana(s[i-1]) && vocala(s[i]) && consoana(s[i+1]))
  26.             cnt ++;
  27.     cout << cnt;
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement