佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 718|回复: 0

help needed!!!

[复制链接]
geralyn 该用户已被删除
发表于 3-2-2007 02:35 PM | 显示全部楼层 |阅读模式
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
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 27-8-2025 03:07 AM , Processed in 0.100955 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表