uses crt,sorting;
const n=10;
var a:mas;
t:byte;
{------------------------------------------------------------}
Procedure initArray(var arr:mas);
var i:integer;
begin
for i:=1 to n do
arr[i].key:=random(20)-10;
end;
{------------------------------------------------------------}
Procedure printArray(arr:mas);
var i:integer;
begin
for i:=1 to n do
write(arr[i].key:2, ' ');
writeln;
end;
{------------------------------------------------------------}
begin
clrscr;
{randomize;}
initArray(a);
printArray(a);
write('Enter the type of sort: ');
readln(t);
case t of
1: straightInsertion(a);
2: straightSelection(a);
3: bubleSort(a);
4: shakerSort(a);
5: quickSort(a,1,n);
else writeln('wrong type');
end;
printArray(a);
readkey;
end.