题目:
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
Subscribe to see which companies asked this question
整数转为罗马数字:
参照罗马数字转整数的规则,可在罗马数字与整数之间建立一个映射, 整数的表示是通过个位,十位,百位,千位来表示,因此只需要将个位,十位,百位,千位的各种情况列举出来即可,代码如下: