var a: array[1..nmax] of real; i, n, j: integer; k: integer;
begin {ввод массива} if handsfree then n := random(nmax - 5) + 5 else begin write('n = '); readln(n); end;
writeln('Данные массива:'); for i := 1 to n do begin if handsfree then begin a[i] := random(random_max - random_min) + random_min; write(a[i], ' '); end else readln(a[i]); end; writeln();
{подсчет элементов} k := 0; for i := 1 to n do if a[i] = 15 then k := k + 1; writeln('quantity = ', k); end.
handsfree = false;
nmax = 31;
random_min = -20;
random_max = 30;
var
a: array[1..nmax] of real;
i, n, j: integer;
k: integer;
begin
{ввод массива}
if handsfree then
n := random(nmax - 5) + 5
else begin
write('n = ');
readln(n);
end;
writeln('Данные массива:');
for i := 1 to n do
begin
if handsfree then begin
a[i] := random(random_max - random_min) + random_min;
write(a[i], ' ');
end
else
readln(a[i]);
end;
writeln();
{подсчет элементов}
k := 0;
for i := 1 to n do
if a[i] = 15 then
k := k + 1;
writeln('quantity = ', k);
end.