标签:
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"
题目:意思很明确,就是将int整数转换成英文数字,difficulty为Hard,我居然解出来了~
思路:说到英文数字表示方法,最大的特点莫过于,每一千是一个节点,三个0为一个读取单词,1000以下则是另一套构词规则,所以首先我想
的是,1000以下搞一套方法,1000以上以这套方法为基础再搞一套,加上各种特出情况的判断,一下:稍等~吃饭
leetcode| Integer to English Words
标签:
原文地址:http://www.cnblogs.com/wujunjie/p/5671195.html