procedure massiv;
var a:array[1..10] of integer;
i,max,min:integer;
begin
min:=1;
max:=1;
randomize;
for i:=1 to 10 do
begin
a[i]:=random(100);
if a[i]<a[min] then min:=i;
if a[i]>a[max] then max:=i;
write(a[i],' ');
end;
writeln('Минимальное ', a[min], ' Максимальное ', a[max]);
if min<max then
for i:= min+1 to max-1 do
write(a[i],' ') else
for i:= max+1 to min-1 do
write(a[i],' ')
end;
begin
massiv()
end.