Вот код сортировки:
Procedure Sortirovka;
var
T:ykazatel;
k,i,j:integer;
st:array[1..30] of ykazatel;
Begin
RestoreCrtMode;
assign(f,filename);
reset(f);
case z of
1: Begin
writeln('***‘®авЁа®ўЄ Ї® ¬ аЄЁ Ё ¬®¤Ґ«Ё ⥫Ґд® ***');
Delay(50000);
k:=1;
while not eof(f) do
Begin
read(f,st[k]);
k:=k+1;
End;
Begin
For i:=1 to n do
Begin
For j:=1 to n do
If st[j].MobileMark<st[j+1].MobileMark then
Begin
T:=st[j];
st[j]:=st[j+1];
st[j+1]:=T;
End;
End;
End;
For i:=1 to n do
Begin
For j:=1 to n do
If st[j].MobileMark=st[j+1].MobileMark then
If st[j].Mobile<st[j+1].Mobile then
Begin
T:=st[j];
st[j]:=st[j+1];
st[j+1]:=T;
End;
End;
close(f);
rewrite(f);
For j:=n downto 1 do
Begin
write(f,st[j]);
read;
End;
TextAttr:=2;
writeln('’Ґ«Ґд®л ®вб®авЁа®ў л!');
TextAttr:=15;
readln;
close(f);
End;
2: Begin
writeln('***‘®авЁа®ўЄ Ї® бв®Ё¬®б⨠⥫Ґд® ***');
Delay(50000);
k:=1;
while not eof(f) do
Begin
read(f,st[k]);
k:=k+1;
End;
Begin
For i:=1 to n do
Begin
For j:=1 to n do
If st[j].Cost<st[j+1].Cost then
Begin
T:=st[j];
st[j]:=st[j+1];
st[j+1]:=T;
End;
End;
End;
close(f);
rewrite(f);
For j:=n downto 1 do
Begin
write(f,st[j]);
read;
End;
TextAttr:=2;
writeln('’Ґ«Ґд®л ®вб®авЁа®ў л!');
TextAttr:=15;
readln;
close(f);
End;
End;
SetGraphMode(GetGraphMode);
End;