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
25
Task/Roman-numerals-Encode/ERRE/roman-numerals-encode.erre
Normal file
25
Task/Roman-numerals-Encode/ERRE/roman-numerals-encode.erre
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
PROGRAM ARAB2ROMAN
|
||||
|
||||
DIM ARABIC%[12],ROMAN$[12]
|
||||
|
||||
PROCEDURE TOROMAN(VALUE->ANS$)
|
||||
LOCAL RESULT$
|
||||
FOR I%=0 TO 12 DO
|
||||
WHILE VALUE>=ARABIC%[I%] DO
|
||||
RESULT$+=ROMAN$[I%]
|
||||
VALUE-=ARABIC%[I%]
|
||||
END WHILE
|
||||
END FOR
|
||||
ANS$=RESULT$
|
||||
END PROCEDURE
|
||||
|
||||
BEGIN
|
||||
!
|
||||
!Testing
|
||||
!
|
||||
ARABIC%[]=(1000,900,500,400,100,90,50,40,10,9,5,4,1)
|
||||
ROMAN$[]=("M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I")
|
||||
TOROMAN(2009->ANS$) PRINT("2009 = ";ANS$)
|
||||
TOROMAN(1666->ANS$) PRINT("1666 = ";ANS$)
|
||||
TOROMAN(3888->ANS$) PRINT("3888 = ";ANS$)
|
||||
END PROGRAM
|
||||
Loading…
Add table
Add a link
Reference in a new issue