#C8105. Number to Words Conversion
Number to Words Conversion
Number to Words Conversion
Given an integer n, your task is to convert it into its English words representation. This problem requires you to handle various cases including negative numbers and zero. For example, if \( n = 123 \), the output should be "One Hundred Twenty Three". Use proper spacing between words and ensure that you follow the standard verbal representation for numbers.
Note: The conversion should use the conventional American English number system. The range of the input is within the 32-bit signed integer range: \( -2^{31} \) to \( 2^{31}-1 \).
inputFormat
The first line contains a single integer, T, denoting the number of test cases.
Each of the next T lines contains a single integer, n.
outputFormat
For each test case, output the English words representation of the integer on a separate line.
## sample4
123
45
-5067
0
One Hundred Twenty Three
Forty Five
Negative Five Thousand Sixty Seven
Zero
</p>