#include <iostream>
#include <sstream>
#include <string>
using namespace std;
bool IsVowel(char ch)
{
static const char* vowels = "aeiouy";
for (const char *p = vowels; *p; ++p) {
if (*p == ch) return true;
}
return false;
}
bool IsConsonant(char ch)
{
static const char* consonants = "bcdfghjklmnpqrstvwxz";
for (const char *p = consonants; *p; ++p) {
if (*p == ch) return true;
}
return false;
}
int main()
{
string line;
getline(cin, line);
stringstream s(line);
string word;
while ((s >> word)) {
int v = 0, c = 0;
for (unsigned int i=0; i<word.length(); ++i) {
if (IsVowel(word[i])) v++;
else if (IsConsonant(word[i])) c++;
}
if (v == c) {
cout << word << endl;
}
}
}
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.