Răspuns:
#include <iostream>
#include <cstring>
using namespace std;
char s[256];
int i;
int total = 0;
int main()
{
cin.get(s, 256);
for(i=1; i<=strlen(s)-2; i++)
{
if(s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')
{
if(s[i-1] != 'a' && s[i-1] != 'e' && s[i-1] != 'i' && s[i-1] != 'o' && s[i-1] != 'u' && s[i+1] != 'a' && s[i+1] != 'e' && s[i+1] != 'i' && s[i+1] != 'o' && s[i+1] != 'u' && s[i-1] != ' ' && s[i+1] != ' ')
total++;
}
}
cout<<total;
return 0;
}
Explicație: