Ответ:
Free Pascal
const
n=10;
var
c : array[0..n-1] of integer = (64, 13, 22, 54, 21, 73, 24, 45, 22, 81);
i, Imin, Iind : integer;
begin
Imin := c[0];
Iind := 0;
for i:= 1 to n-1 do
if imin>c[i] then begin
Imin := c[i];
iind := i
end;
writeln('Min = ', imin, ' Index= ', iind);
for i:=0 to n-1 do begin
if i mod 2 =0 then
c[i] := c[i]+5
else
c[i] := c[i]-5;
write(c[i], ' ')
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
Free Pascal
const
n=10;
var
c : array[0..n-1] of integer = (64, 13, 22, 54, 21, 73, 24, 45, 22, 81);
i, Imin, Iind : integer;
begin
Imin := c[0];
Iind := 0;
for i:= 1 to n-1 do
if imin>c[i] then begin
Imin := c[i];
iind := i
end;
writeln('Min = ', imin, ' Index= ', iind);
for i:=0 to n-1 do begin
if i mod 2 =0 then
c[i] := c[i]+5
else
c[i] := c[i]-5;
write(c[i], ' ')
end;
end.