To read or write a Roman Numeral, follow these rules:
There are seven capital letters in the Roman Numeral "alphabet"
and each letter represents a number as follows:
I = 1
V = 5
X = 10
L = 50
C = 100
D = 500
M = 1000
If two or three letters are the same in a row, then simply
add them together. Like III = 1 + 1 + 1 = 3
A letter can only be repeated three times. For example,
CCC will work, but CCCC is not valid.
If two letters are next to each other, compare the first
and second letter. If the first letter is larger than the
second letter, then add them up together.
For example, XV is 10 + 5 = 15
Again, if two letters are next to each other, compare the first
and second letter. If the first letter is smaller than the
second letter, then subtract the first letter from the second letter.
For example, IX is 10 - 1 = 9
A bar on top of a letter makes it 1000 larger.
There is no Roman Numeral for zero or a negative number.
All Roman Numerals are integers.