Questa è una sfida piuttosto semplice.
Sfida
L'input conterrà una stringa (no null o vuota) di lunghezza massima 100. Emette il numero di vocali in ogni parola della stringa, separate da spazi.
Regole
- La stringa non avrà più di 100 caratteri di lunghezza.
- La stringa conterrà solo alfabeti
A-Z,a-ze può anche contenere spazi. - L'input deve essere consumato dal file
stdinargomenti della riga di comando o. - L'output deve essere emesso in
stdout. - È possibile scrivere un programma completo o una funzione che accetta input dal
stdine genera il risultato. - Le vocali che il tuo programma / funzione deve contare sono
aeioueAEIOU.
Casi test
This is the first test case --> 1 1 1 1 1 2
one plus two equals three --> 2 1 1 3 2
aeiou AEIOU --> 5 5
psst --> 0
the quick brown fox jumped over the lazy dog --> 1 2 1 1 2 2 1 1 1
punteggio
Questo è code-golf , quindi vince l'invio più breve (in byte).
stdincon stdout. Non mi piace "ottenere input" tramite gli argomenti della funzione. gli argomenti della riga di comando sembrano ok. L'ho aggiunto nel post.
The name "vowel" is often used for the symbols that represent vowel sounds in a language's writing system, particularly if the language uses an alphabet. In writing systems based on the Latin alphabet, the letters A, E, I, O, U, and sometimes Y are all used to represent vowels. However, not all of these letters represent vowels in all languages.Cosa intendi per vocali?