12977 - Transcribe Numbers
|
Time |
Memory |
| Case 1 |
1 sec |
32 MB |
| Case 2 |
1 sec |
32 MB |
| Case 3 |
1 sec |
32 MB |
| Case 4 |
1 sec |
32 MB |
Description
- Write a program that asks the user for a two-digit number (10 ~ 99), then prints the English word for the number.
- Break the number into two digits.
- Use a switch statement to print the word for the first digit (i.e. twenty, thirty, etc).
- Use another switch statement to print the second digit.
- Deal with special cases: 11~19.
- If not a double digit number, print "invalid\n".
Input
0 < n <= 99
Output
- A string of characters.
- Or two strings of characters separated by a hyphen "-" character.
Tags