Pregunta de entrevista de CareerBuilder

Write a program that converts Roman numerical to decimal

Respuesta de la entrevista

Anónimo

30 oct 2014

Super simple case - store the numerals 1 - 10 in a simple list in your method. Take in a roman numeral string and romanNumeralList.IndexOf(rn) + 1 to get the decimal. To go higher than 10 would involve seeing if the string passed in is some kind of combination of the base list, then adding up accordingly. At 50, you need to add L, and at 100 you need to include C...so could get hairy, but doable.