var
mas: array[0..11] of integer;
a, c, b: integer;
begin
for a := 0 to 9 do
mas[a] := random(-50, 50);//pascalabc.net позволяет задавать диапазон случайных чисел
write(mas[a], ' ');
if mas[10] > mas[a] then begin mas[10] := mas[a]; b := a; end;
if mas[11] < mas[a] then begin mas[11] := mas[a]; c := a; end;
end;
writeln;
writeln('min[', b, '] = ', mas[10]);
writeln('max[', c, '] = ', mas[11]);
a := mas[b];
mas[b] := mas[c];
mas[c] := a;
for a := 0 to 9 do write(mas[a], ' ');
end.
var
mas: array[0..11] of integer;
a, c, b: integer;
begin
for a := 0 to 9 do
begin
mas[a] := random(-50, 50);//pascalabc.net позволяет задавать диапазон случайных чисел
write(mas[a], ' ');
if mas[10] > mas[a] then begin mas[10] := mas[a]; b := a; end;
if mas[11] < mas[a] then begin mas[11] := mas[a]; c := a; end;
end;
writeln;
writeln('min[', b, '] = ', mas[10]);
writeln('max[', c, '] = ', mas[11]);
a := mas[b];
mas[b] := mas[c];
mas[c] := a;
for a := 0 to 9 do write(mas[a], ' ');
end.