⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sort1.pas

📁 this is a lp0 compilator new
💻 PAS
字号:
PROGRAM Main;TYPE   SortArray = ARRAY [1..10] OF INTEGER;VAR   X            : INTEGER;   Key     	: SortArray;PROCEDURE Merge ( Source : SortArray;	          VAR Destination : SortArray;	          Lower, Mid, Upper : INTEGER );VAR   S1, S2, D	: INTEGER;BEGIN { PROCEDURE Merge }   { Initialize Pointers }   S1 := Lower;   S2 := Mid + 1;   D := Lower;   { Repeat comparison or current items from each list }   { Move what is left of remaining list }   IF ( S1 > Mid ) THEN      BEGIN         FOR S2 := S2 TO Upper DO             BEGIN               Destination[D] := Source[S2];               D := D + 1;            END;      END   ELSE      BEGIN         FOR S1 := S1 TO Upper DO             BEGIN               Destination[D] := Source[S1];               D := D + 1;            END;      END;END; { of Procedure Merge }BEGIN { PROGRAM Main }END.   { of PROGRAM Main }   MergeArray ( Destination, Source1, Source2, D, S1, S2, Mid, Upper );   { Repeat comparison or current items from each list }   REPEAT      IF ( Source[S1] < Source[S2] ) THEN         BEGIN            Destination[D] := Source[S1];            S1 := S1 + 1;         END      ELSE         BEGIN            Destination[D] := Source[S2];            S2 := S2 + 1;         END;      D := D + 1;   UNTIL ( S1 > Mid ) OR ( S2 > Upper );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -