Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,28 @@
|
|||
local fn RomantoDecimal( roman as Str15 ) as short
|
||||
dim as short i, n, preNum, num
|
||||
|
||||
preNum = 0 : num = 0
|
||||
|
||||
for i = roman[0] to 1 step -1
|
||||
n = 0
|
||||
if roman[i] = _"M" then n = 1000
|
||||
if roman[i] = _"D" then n = 500
|
||||
if roman[i] = _"C" then n = 100
|
||||
if roman[i] = _"L" then n = 50
|
||||
if roman[i] = _"X" then n = 10
|
||||
if roman[i] = _"V" then n = 5
|
||||
if roman[i] = _"I" then n = 1
|
||||
if n < preNum then num = num - n else num = num + n
|
||||
preNum = n
|
||||
next
|
||||
end fn = num
|
||||
|
||||
print " MCMXC ="; fn RomantoDecimal( "MCMXC" )
|
||||
print " MMVIII ="; fn RomantoDecimal( "MMVIII" )
|
||||
print " MMXVI ="; fn RomantoDecimal( "MMXVI" )
|
||||
print "MDCLXVI ="; fn RomantoDecimal( "MDCLXVI" )
|
||||
print " MCMXIV ="; fn RomantoDecimal( "MCMXIV" )
|
||||
print " DXIII ="; fn RomantoDecimal( "DXIII" )
|
||||
print " M ="; fn RomantoDecimal( "M" )
|
||||
print " DXIII ="; fn RomantoDecimal( "DXIII" )
|
||||
print " XXXIII ="; fn RomantoDecimal( "XXXIII" )
|
||||
Loading…
Add table
Add a link
Reference in a new issue