Mam spraveny program ale mi to nefunguje. Prosim si od Vas pomoc.
Program je o triedeni MAXSORT
program triedenie;
uses crt;
const N=10;
var pole:array [1..N] of integer;
i,q,j,t:integer;
procedure napln_pole;
begin
for i:=1 to N do pole[i]:=random(100);
end;
procedure vypis_pole;
begin
writeln('prvky pola: ');
for i:=1 to N do write(pole[i],' ');
writeln;
end;
procedure zamen(var a,b:integer);
var temp:integer;
begin
temp:=a;
a:=b;
b:=temp;
end;
procedure MAXSORT;
var imax:integer;
begin
for i:=N downto 2 do
begin
imax:=1;
for j:=2 to i do
if pole[imax] < pole[j] then
begin
imax:=j;
end;
zamen(pole[imax],pole[i]);
end;
end;
begin
clrscr;
randomize;
napln_pole;
vypis_pole;
writeln('Vyber triedenie MAXSORT ');
readln(Q);
case Q of
MAXSORT;
end;
vypis_pole;
readkey;
end.