Op 18-9-2020 om 06:45 schreef Richard
O'Keefe:
Roman numerals are much more complicated and much less consistentthan most people realise. The regular M DC LX VI system is bothmore modern and less capable than anything the Romans would haverecognised. In particular,- in the 8th century, N (short for "nulla") was adopted for zero- the Roman system always had fractions like S for 1/2, . for 1/12- there were numerals for much larger numbers.Unicode code block [2150] has characters for the Roman numeralsincluding216C L ROMAN NUMERAL FIFTY
216D C ROMAN NUMERAL ONE HUNDRED
216E D ROMAN NUMERAL FIVE HUNDRED
216F M ROMAN NUMERAL ONE THOUSAND2181 ↁ ROMAN NUMERAL FIVE THOUSAND
2182 ↂ ROMAN NUMERAL TEN THOUSAND
2187 ↇ ROMAN NUMERAL FIFTY THOUSAND
2188 ↈ ROMAN NUMERAL ONE HUNDRED THOUSAND(In fact these are ligated versions of forms using "apostrophic" brackets;the pattern goes as high as you want, e.g., (((|))) for a million.D and M were originally |) and (|). There is
So the first thing is to make sure that you understand therequirements for the problem.- Are you required to produce ASCII characters, required toproduce Unicode ones, or allowed to produce either?
as far as I can see from the tests only ASCI characters.
- Are you required to support zero?
No
- Are you required to support n/12 fractions (1<=n<=11)?
NO
- Are you allowed, required, or forbidden to use the "overline"convention, where an overline means "multiply by 1000"?=-------
In the test that one is not used.
ICCXXXIVDLXVII = 1,234,567- Are you allowed, required, or forbidden to use "additive"form "IIII" as well as/instead of "subtractive" form "IV"?- Are you to use upper case or lower case letters?
- And so on.
the number 4 needs to be "IV"
Roelof