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

📄 piksr2.dem

📁 Delphi Pascal 数据挖掘领域算法包 数值算法大全
💻 DEM
字号:
PROGRAM d8r2(input,output,dfile);
(* driver for routine PIKSR2 *)
CONST
   np=100;
TYPE
   glsarray = ARRAY [1..np] OF real;
VAR
   i,j : integer;
   a,b : glsarray;
   dfile : text;

(*$I MODFILE.PAS *)
(*$I PIKSR2.PAS *)

BEGIN
   glopen(dfile,'tarray.dat');
   readln(dfile);
   FOR i := 1 to np DO BEGIN
      read(dfile,a[i])
   END;
   close(dfile);
(* generate b-array *)
   FOR i := 1 to np DO BEGIN
      b[i] := i-1
   END;
(* sort a and mix b *)
   piksr2(np,a,b);
   writeln('after sorting a and mixing b, array a is:');
   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;
   writeln('... and array b is:');
   FOR i := 1 to 10 DO BEGIN
      FOR j := 1 to 10 DO BEGIN
         write(b[10*(i-1)+j]:6:2)
      END;
      writeln
   END;
   writeln('press return to continue ...');
   readln;
(* sort b and mix a *)
   piksr2(np,b,a);
   writeln('after sorting b and mixing a, array a is:');
   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;
   writeln('... and array b is:');
   FOR i := 1 to 10 DO BEGIN
      FOR j := 1 to 10 DO BEGIN
         write(b[10*(i-1)+j]:6:2)
      END;
      writeln
   END
END.

⌨️ 快捷键说明

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