const
n=5; m=6;
var
b:array [1..n,1..m] of integer;
i,j,pol,pus:integer;
begin
pus:=0; pol:=0;
for i:=1 to n do
for j:=1 to m do
b[i,j]:=random(21)-10;
write(b[i,j]:4);
if (b[i,j]>0) then
inc(pol)
else
if b[i,j]=0 then
inc(pus);
end;
writeln;
writeln('Положительных: ',pol);
writeln('Отрицательных: ',n*m-pus-pol);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
const
n=5; m=6;
var
b:array [1..n,1..m] of integer;
i,j,pol,pus:integer;
begin
pus:=0; pol:=0;
for i:=1 to n do
begin
for j:=1 to m do
begin
b[i,j]:=random(21)-10;
write(b[i,j]:4);
if (b[i,j]>0) then
inc(pol)
else
if b[i,j]=0 then
inc(pus);
end;
writeln;
end;
writeln('Положительных: ',pol);
writeln('Отрицательных: ',n*m-pus-pol);
end.