
描述
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
分析
要考虑罗马数字的加法规则和减法规则,要写对还是有一定技巧的,下面是一个精巧的解法。
代码
Python
1 |
class (object): |

Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
要考虑罗马数字的加法规则和减法规则,要写对还是有一定技巧的,下面是一个精巧的解法。
1 |
class (object): |
近期评论