home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
PASCAL
/
NRPAS13.ZIP
/
SHELL.DEM
< prev
next >
Wrap
Text File
|
1991-04-29
|
742b
|
35 lines
PROGRAM d8r9(input,output,dfile);
(* driver for routine SHELL *)
CONST
npt=100;
TYPE
glnarray = ARRAY [1..npt] OF real;
VAR
i,j : integer;
a : glnarray;
dfile : text;
(*$I MODFILE.PAS *)
(*$I SHELL.PAS *)
BEGIN
glopen(dfile,'tarray.dat');
readln(dfile);
FOR i := 1 to npt DO read(dfile,a[i]);
close(dfile);
(* write original array *)
writeln('Original array:');
FOR i := 1 to (npt DIV 10) DO BEGIN
FOR j := 1 to 10 DO write(a[10*(i-1)+j]:6:2);
writeln
END;
(* write sorted array *)
shell(npt,a);
writeln;
writeln('Sorted array:');
FOR i := 1 to (npt DIV 10) DO BEGIN
FOR j := 1 to 10 DO write(a[10*(i-1)+j]:6:2);
writeln
END;
END.