var a: array[1..n] of real; i: integer; sum: real;
begin {ввод массива} writeln('Данные массива:'); for i := 1 to n do begin if handsfree then begin a[i] := random(100) - 50; write(a[i], ' '); end else readln(a[i]); end; writeln();
{подсчет суммы и произведения} sum := 0; for i := 1 to n do begin if a[i] > 10 then sum := sum + a[i]; end; writeln('sum = ', sum); end.
Answers & Comments
Verified answer
Consthandsfree = true;
n = 15;
var
a: array[1..n] of real;
i: integer;
sum: real;
begin
{ввод массива}
writeln('Данные массива:');
for i := 1 to n do
begin
if handsfree then begin
a[i] := random(100) - 50;
write(a[i], ' ');
end
else readln(a[i]);
end;
writeln();
{подсчет суммы и произведения}
sum := 0;
for i := 1 to n do
begin
if a[i] > 10 then
sum := sum + a[i];
end;
writeln('sum = ', sum);
end.