Условие
Показать переводCount how many characters in text are vowels: a, e, i, o, u in either uppercase or lowercase.
Implement count_vowels(text).
Input
text: The text to inspect (ASCII characters).
Output
Return the number of vowels.
Ограничения
0 ≤ length ≤ 10,000
Примеры
Пример 1
Ввод:
text = "Hello World"
Ожидаемый вывод:
expected = 3
Ввод:
std::string text = "Hello World";
Ожидаемый вывод:
long long expected = 3;
Ввод:
string text = "Hello World";
Ожидаемый вывод:
long expected = 3;
Пояснение
e, o and o are vowels: 3.
Пример 2
Ввод:
text = "AEIOU and y"
Ожидаемый вывод:
expected = 6
Ввод:
std::string text = "AEIOU and y";
Ожидаемый вывод:
long long expected = 6;
Ввод:
string text = "AEIOU and y";
Ожидаемый вывод:
long expected = 6;
Пояснение
A, E, I, O, U, a are vowels; y is not counted: 6.
Ссылки
Это задание адаптировано для CodeUtility. Следуйте условию и ограничениям выше.