piksrt.dem
来自「Delphi Pascal 数据挖掘领域算法包 数值算法大全」· DEM 代码 · 共 40 行
DEM
40 行
PROGRAM d8r1(input,output,dfile);
(* driver for routine PIKSRT *)
CONST
np=100;
TYPE
glsarray = ARRAY [1..np] OF real;
VAR
i,j : integer;
a : glsarray;
dfile : text;
(*$I MODFILE.PAS *)
(*$I PIKSRT.PAS *)
BEGIN
glopen(dfile,'tarray.dat');
readln(dfile);
FOR i := 1 to 100 DO BEGIN
read(dfile,a[i])
END;
close(dfile);
(* write original array *)
writeln ('original array:');
FOR i := 1 to 10 DO BEGIN
FOR j := 1 to 10 DO BEGIN
write(a[10*(i-1)+j]:6:2)
END;
writeln
END;
(* write sorted array *)
piksrt(np,a);
writeln('sorted array:');
FOR i := 1 to 10 DO BEGIN
FOR j := 1 to 10 DO BEGIN
write(a[10*(i-1)+j]:6:2)
END;
writeln
END
END.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?