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
21
Task/Equilibrium-index/ERRE/equilibrium-index.erre
Normal file
21
Task/Equilibrium-index/ERRE/equilibrium-index.erre
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
PROGRAM EQUILIBRIUM
|
||||
|
||||
DIM LISTA[6]
|
||||
|
||||
PROCEDURE EQ(LISTA[]->RES$)
|
||||
LOCAL I%,R,S,E$
|
||||
FOR I%=0 TO UBOUND(LISTA,1) DO
|
||||
S+=LISTA[I%]
|
||||
END FOR
|
||||
FOR I%=0 TO UBOUND(LISTA,1) DO
|
||||
IF R=S-R-LISTA[I%] THEN E$+=STR$(I%)+"," END IF
|
||||
R+=LISTA[I%]
|
||||
END FOR
|
||||
RES$=LEFT$(E$,LEN(E$)-1)
|
||||
END PROCEDURE
|
||||
|
||||
BEGIN
|
||||
LISTA[]=(-7,1,5,2,-4,3,0)
|
||||
EQ(LISTA[]->RES$)
|
||||
PRINT("Equilibrium indices are";RES$)
|
||||
END PROGRAM
|
||||
Loading…
Add table
Add a link
Reference in a new issue