Siema potrzebuje pomocy w programie. Program wypełnia tablice losowymi literami i sortuje je od od a do z. Problem polega na tym iż nie mam pomysłu jak zrobić to na tablicy dwuwymiarowej i żeby sortowało od z do a.
program project1;
uses SysUtils;
const
min=1;
max=5;
type
tElem = char;
tTablica = array [min..max] of tElem;
var
t:tTablica;
procedure sortuj(l,r: longint);
var
i,j: integer;
x,y: tElem;
begin
i:=l; j:=r; x:=t[(l+r) DIV 2];
repeat
while t[i]<x do i:=i+1;
while x<t[j] do j:=j-1;
if i<=j then begin
y:=t[i]; t[i]:=t[j]; t[j]:=y;
i:=i+1; j:=j-1;
end;
until i>j;
if l<j then sortuj(l,j);
if i<r then sortuj(i,r);
end;
var
i:integer;
begin
randomize;
for i:=min to max do
t[i]:=char( random( ord('Z')-ord('A') + 1) + ord('A')
);
for i:=min to max do write(t[i]:2); writeln; writeln;
sortuj(min, max);
for i:=min to max do write(t[i]:2); writeln;
readln;
end.