LeetCode 12. Integer to Roman
Description
Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999.
将整型转换成罗马数字形式:
Symbol | Value |
---|---|
I | 1 |
V | 5 |
X | 10 |
L | 50 |
C | 100 |
D | 500 |
M | 1000 |
Solution
因为限定了范围,所以千位数也用了Slice
|
|