Leetcode 13. 罗马数字转整数

按照罗马数字规则 对每一位:其右边大,减去这个数;其右边小,加上这个数 最后再加上最右边的数web class Solution { public: int romanToInt(string s) { map<char, int> A; int ans = 0; A['I'] = 1, A['V'] = 5, A['X'] = 10, A[
相关文章
相关标签/搜索