请将给出的罗马数字转化为整数 保证输入的数字范围在1 到 3999之间。
示例1
输入
"MCMXCVI"
输出
1996
加载中...
import java.util.*; public class Solution { /** * * @param s string字符串 * @return int整型 */ public int romanToInt (String s) { // write code here } }
class Solution { public: /** * * @param s string字符串 * @return int整型 */ int romanToInt(string s) { // write code here } };
# # # @param s string字符串 # @return int整型 # class Solution: def romanToInt(self , s ): # write code here
/** * * @param s string字符串 * @return int整型 */ function romanToInt( s ) { // write code here } module.exports = { romanToInt : romanToInt };
# # # @param s string字符串 # @return int整型 # class Solution: def romanToInt(self , s ): # write code here
package main /** * * @param s string字符串 * @return int整型 */ func romanToInt( s string ) int { // write code here }
"MCMXCVI"
1996