C++ |
1
2
3
4
5
6
7
8
| bool isVowel(const int c){if (c=='a' || c=='e' || c=='i' || c=='o' || c=='u') return true; return false;}
bool isConsonant(const int c){return !isVowel(c);}
int main()
{
char str[]="test string";
cout<< (count_if(str,str+strlen(str),isVowel) > count_if(str,str+strlen(str),isConsonant) ? "vowel" : "consonant");
} |
|
Добавлено через 1 минуту
Не по теме:
Jupiter, хороший вопрос, неужели go создаёт новый стандарт и пишет библиотеку std 