ID13. Roman to Integer Add to List QuestionEditorial Solution My Submissions
Total Accepted: 117446
Total Submissions: 273074
Difficulty: Easy
Contributors: Admin
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
这道题同
http://deepdim.com/2016/12/01/Integer-to-Roman/
需要特殊处理的有:
代码:
其中较为关键的是判断什么时候进行i++
if((CurString!=roman[i])||s.substr(index+roman[i].size(),roman[i].size())!=roman[i])
即只有在当前不匹配或者下个不匹配的时候才进行i++从而实现了最大三个字母的重复。。