Fácil20 pts
Roman to Integer
Traducción al español en progresoEl contenido detallado de esta lección aún se está traduciendo. Mientras tanto, se muestra en inglés.
Convert a Roman numeral string to an integer. I=1, V=5, X=10, L=50, C=100, D=500, M=1000 If smaller value before larger, subtract (IV=4). Otherwise add. Example: 'MCMXCIV' → 1994 (M=1000 + CM=900 + XC=90 + IV=4)
Entrada
A single line containing a Roman numeral string.
Salida
The integer value.
Ejemplo
MCMXCIV
Esperado
1994
Loading editor…
Resultado
Sin salida aún. Ejecuta tu código para ver resultados.