0
Anyone can help me how to convert real number to Romawi number and input 1-5000??? Thanks
Java
9 Respostas
+ 3
I would store theese letters:
I (1)
V (5)
X (10)
L (50)
C (100)
D (500)
M (1000)
I would store also store these special roman numbers:
IV (4)
IX (9)
XL (40)
XC (90)
CD (400)
CM (900)
they are used to avoid 4 equal letters: instead of IIII use IV
Start with the largest roman number and subtract it from your decimal number as often as possible.
For example 289:
289 - 100 = 189
189 - 100 = 89
-> subtract 100 two times -> CC
89 - 50 = 39
->CCL
39 - 10 = 29
29 - 10 = 19
19 - 10 = 9
-> CCLXXX
9 = IX
-> CCLXXXIX
512:
512 - 500 = 12
-> D
12 - 10 = 2
->DX
2 = II
-> DXII
Hope this helps.
+ 2
Thanks
+ 1
You mean roman I, II, III, IV... numbers?
+ 1
Thanks
0
Romawi?
0
Like I II III IV V ... X
0
Ok, yes
0
Example If input 1 = I
2 = II ... 9 = IX like that
0
Yes