This question already has an answer here:
- Roman numeral converter function 1 answer
The usual rules: no external resources, or the like. Input will be a positive integer in valid Roman numeral format less than 10 thousand, say.
Use all the Roman numeral characters:
- I = 1
- V = 5
- X = 10
- L = 50
- C = 100
- D = 500
- M = 1,000
Respect subtractive notation (copied from the Wikipedia page):
- the numeral I can be placed before V and X to make 4 units (IV) and 9 units (IX) respectively
- X can be placed before L and C to make 40 (XL) and 90 (XC) respectively
- C can be placed before D and M to make 400 (CD) and 900 (CM) according to the same pattern[5]
MMMMMMMMMM
or something else? – ProgramFOX yesterday