Question
Mi ne parolas Esperanton (use only c language) Lili is learning Esperanto and now she wants your help to convert numbers less than 10000 from
Mi ne parolas Esperanton (use only c language) Lili is learning Esperanto and now she wants your help to convert numbers less than 10000 from digit to words in the language. Fortunately the number system in Esperanto is quite simple, it is arguably simpler than in English or Indonesian. The following tables show how to say some numbers in Esperanto: 1 unu 10 dek 100 cent 1000 mil 2 du 20 dudek 200 ducent 2000 du mil 3 tri 30 tridek 300 tricent 3000 tri mil 4 kvar 40 kvardek 400 kvarcent 4000 kvar mil 5 kvin 50 kvindek 500 kvincent 5000 kvin mil 6 ses 60 sesdek 600 sescent 6000 ses mil 7 sep 70 sepdek 700 sepcent 7000 sep mil 8 ok 80 okdek 800 okcent 8000 ok mil 9 na 90 nadek 900 nacent 9000 na mil Notice that: Theres a pattern, for example sescent (600) is a combination of ses (6) and cent (100). There are no spaces in dudek, tridek, etc. and ducent, tricent, etc. but there is one in du mil, tri mil, etc. All other numbers less than 10000 that arent in the table can be formed in a predictable way, here are some examples (more examples can be seen in sample input/output): 17 = dek sep, from dek (10) and sep (7). 69 = sesdek na, from sesdek (60) and na (9). 101 = cent unu, from cent (100) and unu (1). 123 = cent dudek tri, from cent (100), dudek (20) and tri (3). 420 = kvarcent dudek, from kvarcent (400) and dudek (20). 1005 = mil kvin, from mil (10) and kvin (5). 1111 = mil cent dek unu, from mil (1000), cent (100), dek (10) and unu (1). 1337 = mil tricent tridek sep, from mil (1000), tricent (300), tridek (30) and sep (7). Format Input The first line contains a single number T, the number of testcases. Each testcase contains a number N, which is the number to be converted to words. Format Output For each testcase, output one line starting with Case #X: (without quotes) where X is the testcase number (starting from 1) followed by the number after being converted to words. You might have noticed that Esperanto has the letter which doesnt exist in both English and Indonesian, so to keep things simple on your program please just use the normal u as a substitute for . Constraints 1 T 5000 1 N 9999 Sample Input 1 (standard input) 10 5 10 700 1100 2000 2019 2020 6105 7980 9999 Sample Output 1 (standard output) Case #1: kvin Case #2: dek Case #3: sepcent Case #4: mil cent Case #5: du mil Case #6: du mil dek nau Case #7: du mil dudek Case #8: ses mil cent kvin Case #9: sep mil naucent okdek Case #10: nau mil naucent naudek nau
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started