var a: array[1..100] of real; i, n: integer; t, sum: real;
begin {ввод массива} if handsfree then n := random(20) + 5 else begin write('n = '); readln(n); end;
writeln('Данные массива:'); for i := 1 to n do begin if handsfree then begin a[i] := random(100); write(a[i], ' '); end else readln(a[i]); end; writeln();
{подсчет элементов} write('k = '); readln(t); sum := 0; for i := 1 to n do if a[i] < t then sum := sum + a[i]; writeln('sum = ', sum); end.
handsfree = true;
var
a: array[1..100] of real;
i, n: integer;
t, sum: real;
begin
{ввод массива}
if handsfree then
n := random(20) + 5
else begin
write('n = ');
readln(n);
end;
writeln('Данные массива:');
for i := 1 to n do
begin
if handsfree then begin
a[i] := random(100);
write(a[i], ' ');
end
else readln(a[i]);
end;
writeln();
{подсчет элементов}
write('k = ');
readln(t);
sum := 0;
for i := 1 to n do
if a[i] < t then sum := sum + a[i];
writeln('sum = ', sum);
end.