a:array [1..100,1..100] of real; n,m,k:integer; begin clrscr; randomize; write('N='); read(n); write('M='); read(m); for n:=1 to n do for m:=1 to m do a[n,m]:=random(100)-50; for n:=1 to n do begin for m:=1 to m do write(a[n,m],' '); writeln; end; for n:= 1 to n do begin k:=0; for m:= 1 to m do begin if a[n,m]<0 then k:=k+1; end; writeln('Кол-во отрицательных элементов ',n,' строки: ',k);
Answers & Comments
uses crt;
var
a:array [1..100,1..100] of real;
n,m,k:integer;
begin
clrscr;
randomize;
write('N='); read(n);
write('M='); read(m);
for n:=1 to n do
for m:=1 to m do
a[n,m]:=random(100)-50;
for n:=1 to n do
begin
for m:=1 to m do
write(a[n,m],' ');
writeln;
end;
for n:= 1 to n do
begin
k:=0;
for m:= 1 to m do
begin
if a[n,m]<0 then
k:=k+1;
end;
writeln('Кол-во отрицательных элементов ',n,' строки: ',k);
end;
end.