KyrieSu / Code_cpp

0 stars 0 forks source link

013. Integer to English Words #15

Open KyrieSu opened 8 years ago

KyrieSu commented 8 years ago

Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.

For example,

123 -> "One Hundred Twenty Three"
12345 -> "Twelve Thousand Three Hundred Forty Five"
1234567 -> "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"

Note : There are many edge cases. What are some good test cases? Does your code work with input such as 0? or 1000010? (middle chunk is zero and should not be printed out)

KyrieSu commented 8 years ago

這一題要討論怎麼做才能做到 no bug and as simple as possible

請不要吝嗇提供你腦袋的想法

LarryLuTW commented 8 years ago

感覺不難 但是很複雜XD 100以內的數字 1~19 要做特別處理 因為只有一個單字 20 以上就都用兩個單字組合