No label this time
Roman numerals write a number as pieces from a fixed menu: M is 1000, D is 500, C is 100, L is 50, X is 10, V is 5 and I is 1. 1994 is written MCMXCIV. To make it short, the Romans also had pairs where a small piece sits before a bigger one and is taken away: IV is 4, IX is 9, XL is 40, XC is 90, CD is 400 and CM is 900.
A small hint for this one. Put all thirteen pieces in order from biggest to smallest, in two lists that line up: the values and the symbols.
Before coding: what is the menu, and what order should I try it in?
Writing 1994
1000
0900
1500
2400
3100
490
550
640
710
89
95
104
111
12value
- n
- 994
- result
- M
Start with 1994. The biggest piece that fits is 1000, which is M. Take it away: 994 is left. The text so far is M.
Move 1 of 4