#K64622. Number to English Words
Number to English Words
Number to English Words
Given an integer n
where \( -999{,}999 \le n \le 999{,}999 \), convert it to its English word representation.
If the number is negative, the output should start with the word minus
. The words should be in lower-case and numbers should be expressed in their natural English words.
For example:
- Input:
123
→ Output:one hundred twenty three
- Input:
-45
→ Output:minus forty five
- Input:
500034
→ Output:five hundred thousand thirty four
Note: Your program should read the input from stdin
and print the output to stdout
.
inputFormat
The input consists of a single line containing an integer n
where \( -999{,}999 \le n \le 999{,}999 \).
Input is read from stdin
.
outputFormat
Output the English word representation of n
in lower-case. If n
is negative, the word representation must begin with minus
.
Output is written to stdout
.
0
zero