const n=16;
var a:array [1..n] of integer;
i,k:integer;
begin
write('Массив: ');
for i:=1 to n do
a[i]:=random(41)-20;
if a[i] < 0 then k:=k+1;
write(a[i],' ')
end;
writeln;
writeln('Отрицательных элементов: ',k)
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
const n=16;
var a:array [1..n] of integer;
i,k:integer;
begin
write('Массив: ');
for i:=1 to n do
begin
a[i]:=random(41)-20;
if a[i] < 0 then k:=k+1;
write(a[i],' ')
end;
writeln;
writeln('Отрицательных элементов: ',k)
end.