const n = 10; var a: array[1..n] of integer; i, min: integer; begin min := 20; for i := 1 to n do begin a[i] := random(20); if(a[i] < min) then min := a[i]; write(a[i], ' '); end; writeln; writeln('Минимальный эл. массива: ', min); for i := 1 to n do begin if(i mod 2 <> 0) then a[i] := min; write(a[i], ' '); end; end.
Answers & Comments
const n = 10;
var
a: array[1..n] of integer;
i, min: integer;
begin
min := 20;
for i := 1 to n do begin
a[i] := random(20);
if(a[i] < min) then min := a[i];
write(a[i], ' ');
end;
writeln; writeln('Минимальный эл. массива: ', min);
for i := 1 to n do begin
if(i mod 2 <> 0) then a[i] := min;
write(a[i], ' ');
end;
end.