Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,43 @@
|
|||
MODULE RD;
|
||||
|
||||
IMPORT Out;
|
||||
|
||||
TYPE
|
||||
TArray = ARRAY 7 OF INTEGER;
|
||||
|
||||
VAR
|
||||
DataArray,ResultArray:TArray;
|
||||
ResultIndex,LastResultIndex,Position:LONGINT;
|
||||
IsNewNumber:BOOLEAN;
|
||||
|
||||
PROCEDURE Init(VAR A:TArray);
|
||||
BEGIN
|
||||
A[0] := 1; A[1] := 2; A[2] := 2; A[3] := 3;
|
||||
A[4] := 4; A[5] := 5; A[6] := 5;
|
||||
END Init;
|
||||
|
||||
BEGIN
|
||||
Init(DataArray);
|
||||
ResultArray[0] := DataArray[0];
|
||||
LastResultIndex := 0;
|
||||
Position := 0;
|
||||
WHILE Position < LEN(DataArray)-1 DO
|
||||
INC(Position);
|
||||
IsNewNumber := TRUE;
|
||||
ResultIndex := 0;
|
||||
WHILE(ResultIndex <= LastResultIndex) & (IsNewNumber) DO
|
||||
IF DataArray[Position] = ResultArray[ResultIndex] THEN
|
||||
IsNewNumber := FALSE;
|
||||
END;
|
||||
INC(ResultIndex);
|
||||
END;
|
||||
IF IsNewNumber THEN
|
||||
INC(LastResultIndex);
|
||||
ResultArray[LastResultIndex] := DataArray[Position];
|
||||
END;
|
||||
END;
|
||||
FOR ResultIndex := 0 TO LastResultIndex DO
|
||||
Out.Int(ResultArray[ResultIndex],0); Out.Char(' ');
|
||||
END;
|
||||
Out.Ln;
|
||||
END RD.
|
||||
Loading…
Add table
Add a link
Reference in a new issue