LeetCode13 - romanToInt

题目来源:

https://leetcode-cn.com/problems/roman-to-integer/description/

题目


LeetCode13 - romanToInt_第1张图片

分析:

对于整数转罗马数字:可以通过组合数字进行拆分,使程序实现连加

对于罗马数字转整数:通过判断大数左边的数字判断加减。


代码实现:

LeetCode13 - romanToInt_第2张图片

你可能感兴趣的:(LeetCode13 - romanToInt)