查看: 718|回复: 0
|
help needed!!!
[复制链接]
|
|
Write a program roman.java that requests a year from the user. Assuming that the executable is roman, a sample run of the program is shown below. User input is denoted in bold. Enter the year : 1Year 1 in roman numerals is I. | Enter the year : 2006Year 2006 in roman numerals is MMVI. | Enter the year : 1998Year 1998 in roman numerals is MCMXCVIII. | Enter the year : 9999Year 9999 in roman numerals is MMMMMMMMMCMXCIX. | Enter the year : 9888Year 9888 in roman numerals is MMMMMMMMMDCCCLXXXVIII. | I represents 1.IIII to represent 4 is forbidden because there is a shorter notation.V represents 5. Placing I before V (i.e. IV) will mean subtract I from V.Placing I after V (i.e. VI) will mean add I to V.X represents 10.L represents 50 .
C represents 100.
D represents 500.
M represents 1000 |
|
|
|
|
|
|
| |
本周最热论坛帖子
|