var
B: array [1..14] of Real;
i: Integer;
s: Real;
begin
Randomize;
WriteLn ('Mассив:');
for i := Low (B) to High (B) do begin
B [i] := Random (100) - 50;
Write (B [i]:5:2, ' ');
end;
s := 0;
if B [i] > 0 then
s := s + B [i];
WriteLn;
WriteLn ('Сумма положительных элементов массива = ', s:5:2);
end.
var
B: array [1..14] of Real;
i: Integer;
s: Real;
begin
Randomize;
WriteLn ('Mассив:');
for i := Low (B) to High (B) do begin
B [i] := Random (100) - 50;
Write (B [i]:5:2, ' ');
end;
s := 0;
for i := Low (B) to High (B) do begin
if B [i] > 0 then
s := s + B [i];
end;
WriteLn;
WriteLn ('Сумма положительных элементов массива = ', s:5:2);
end.