2015年8月16日

摘要: Add DigitsGiven a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is... 阅读全文

posted @ 2015-08-16 14:33 Maples7 阅读(784) 评论(0) 推荐(0)

摘要: Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.首先学习一下罗马数字的规则:羅馬數字共有7個,即I(1)... 阅读全文

posted @ 2015-08-16 13:39 Maples7 阅读(450) 评论(0) 推荐(1)