Var a: array [1..100] of integer;
n, i, j: integer;
fout: text;
begin
assign(fout, 'output.txt');
rewrite(fout);
n := 10; //n - длина массива
for i := 1 to n do
a[i] := random(100);
for i := 1 to n do
write(fout, a[i], ' ');
writeln(fout);
j := 1;
for i := 2 to n do
if a[i] > a[j] then
j := i;
writeln(fout, 'max = ', a[j], ' max_ind = ', j);
j := 1;
for i := 2 to n do
if a[i] < a[j] then
j := i;
writeln(fout, 'min = ', a[j], ' min_ind = ', j);
close(fout);
end.