Write a script/function/program that converts a user inputted number or Roman numeral to its equivalent?
显示 更早的评论
1) Write a script/function/program that converts a user inputted number or Roman numeral to its equivalent.
Recall Roman Numerals where:
I = 1
V = 5
X = 10
L = 50
C = 100
D = 500
M = 1000
Also remember IX is 9 (10 - 1) while XI = 11 (10+1) but XIX = 19 (10+9)
Most likely you will use the following function: str = input('Roman numeral: ','s')
Just to clarify -- your program should prompt a user to convert a Roman numeral into it’s numerical equivalent or take a number and output the equivalent Roman numeral.
回答(1 个)
Sean de Wolski
2014-11-6
0 个投票
No reason to reinvent the wheel.
类别
在 帮助中心 和 File Exchange 中查找有关 Operators and Elementary Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!