31 lines
544 B
Plaintext
31 lines
544 B
Plaintext
OPTION BASE 1
|
|
LET max = 10
|
|
DIM dat(10), res(10)
|
|
FOR i = 1 TO max
|
|
READ dat(i)
|
|
NEXT i
|
|
|
|
DATA 1, 2, 1, 4, 5, 2, 15, 1, 3, 4
|
|
|
|
LET res(1) = dat(1)
|
|
LET count = 1
|
|
LET posic = 1
|
|
DO WHILE posic < max
|
|
LET posic = posic + 1
|
|
LET esnuevo = 1
|
|
LET indice = 1
|
|
DO WHILE (indice <= count) AND esnuevo = 1
|
|
IF dat(posic) = res(indice) THEN LET esnuevo = 0
|
|
LET indice = indice + 1
|
|
LOOP
|
|
IF esnuevo = 1 THEN
|
|
LET count = count + 1
|
|
LET res(count) = dat(posic)
|
|
END IF
|
|
LOOP
|
|
|
|
FOR i = 1 TO count
|
|
PRINT res(i);
|
|
NEXT i
|
|
END
|