Leetcode在线编程 integer-to-roman
题目链接
题目描述
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
题意
将给定的数字转换成罗马数字[1,3999]
解题思路
罗马数字通过
基本字符
I :1
V:5
X:10
L:50
C:100
D:500
M:10001)相同的数字连写、所表示的数等于这些数字相加得到的数、如:Ⅲ=3;
2)小的数字在大的数字的右边、所表示的数等于这些数字相加得到的数、 如:Ⅷ=8、Ⅻ=12;
3)小的数字、(限于 Ⅰ、X 和 C)在大的数字的左边、所表示的数等于大数减小数得到的数、如:Ⅳ=4、Ⅸ=9&#x