program SumArray;
var
a: array [1..20] of Integer;
i, s: Integer;
begin
Randomize;
for i := Low (a) to High (a) do begin
a [i] := Random (10) - 2;
Write (a [i] :3);
end;
s := 0;
if a [i] > 0 then
s := s + a [i];
WriteLn;
WriteLn ('Сумма = ', s);
ReadLn;
end.
program SumArray;
var
a: array [1..20] of Integer;
i, s: Integer;
begin
Randomize;
for i := Low (a) to High (a) do begin
a [i] := Random (10) - 2;
Write (a [i] :3);
end;
s := 0;
for i := Low (a) to High (a) do begin
if a [i] > 0 then
s := s + a [i];
end;
WriteLn;
WriteLn ('Сумма = ', s);
ReadLn;
end.