ответ:program q174147740;
var
i, max, min: integer;
a: array [1..20] of integer;
begin
Randomize;
for i := 1 to 20 do
a[i] := Random(100);
Write(a[i]:3);
if (i = 1) then
max := a[i];
min := a[i];
end
else
if (a[i] > max) then
if (a[i] < min) then
end;
WriteLn;
WriteLn('Сумма: ', max + min);
ReadLn;
end.
Объяснение:
ответ:program q174147740;
var
i, max, min: integer;
a: array [1..20] of integer;
begin
Randomize;
for i := 1 to 20 do
begin
a[i] := Random(100);
Write(a[i]:3);
if (i = 1) then
begin
max := a[i];
min := a[i];
end
else
begin
if (a[i] > max) then
max := a[i];
if (a[i] < min) then
min := a[i];
end;
end;
WriteLn;
WriteLn('Сумма: ', max + min);
ReadLn;
end.
Объяснение: