Объяснение:
const
n = 10;
a = 1;
b = 20;
var
ar:array[1..n] of integer;
i:integer;
min, i_min:integer;
begin
randomize;
for i:=1 to n do
ar[i]:=random(b-a+1)+a;
write(ar[i], ' ');
writeln;
i_min:=1;
min:=ar[1];
for i:=2 to n do
if (ar[i]<min) then begin
min:=ar[i];
i_min:=i;
end;
writeln(i_min);
end.
Объяснение:
const
n = 10;
a = 1;
b = 20;
var
ar:array[1..n] of integer;
i:integer;
min, i_min:integer;
begin
randomize;
for i:=1 to n do
ar[i]:=random(b-a+1)+a;
for i:=1 to n do
write(ar[i], ' ');
writeln;
i_min:=1;
min:=ar[1];
for i:=2 to n do
if (ar[i]<min) then begin
min:=ar[i];
i_min:=i;
end;
writeln(i_min);
end.