//PascalABC.Net 3.1 сборка 1200
begin
var a := ArrRandom(20, -50, 50);
a.Println;
//1
writeln('Max = ', a.Max, ' Index = ', a.Length - a.Reverse().ToArray.IndexMax);
//2
swap(a[a.IndexMax], a[a.IndexMin]);
a.Println;
//3
a.Sorted.Println;
a.SortedDescending.Println;
end.