Hard
Numbers in Words
Write helper functions to spell a number from 0 to 9999 in English words, e.g. 1203 →
one thousand two hundred three, 40 → forty, 0 → zero. Don't use "and"; join tens and units with a hyphen (forty-two). Read numbers on one line and print each in words on its own line.Input
Integers separated by spaces.
Output
Lines.
Sample 1
Input
1203 40 0
Output
one thousand two hundred three forty zero
Sample 2
Input
42
Output
forty-two
Output appears here