Легко Решено: 0 Процент решений: 0%

Count Vowels

Count the vowels in a piece of text.

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. Следуйте условию и ограничениям выше.

Учитесь у других

Решения сообщества

Пока нет опубликованных решений. Решите задание, чтобы поделиться первым.