sequence arg=command_line()
integer dim = length(arg)
if match("peu",arg[1]) then arg=arg[2..] dim-=1 end if
if dim < 2 then
puts(1,"Usage: roman <value>\n")
abort(0)
end if
integer num=value(arg[2]) num=num[2]
sequence roman = { "M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I" } ,
waarde= {1000, 900 , 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1} ,
result= {}
for i= 1 to 13 do
while num >= waarde[i] do
result&=roman[i]
num-=waarde[i]
end while
end for
printf(1,"Roman = %s\n",result)