Free Pascal
var
a : array of array of integer;
b : array of integer;
s, i, j, n, m : integer;
begin
writeln('Введите кол-во строк:');
readln(m);
writeln('Введите кол-во столбцов:');
readln(n);
randomize;
setlength(a, n);
setlength(b, m);
for i:=0 to n-1 do
setlength(a[i], m);
for j:=0 to m-1 do begin
s:=0;
for i:=0 to n-1 do begin
a[i,j] := random(50) - 25;
if a[i,j] <0 then inc(s);
write(a[i, j], ' ');
end;
b[j]:=s;
writeln();
writeln('--------------------------');
for j:=0 to m-1 do
writeln(j+1,' строка = ', b[j]);
end.
##
var n := ReadInteger;
var a := ArrRandom(n, -28, 27);
a.Println.Where(t -> t.Divs(3)).Product.Print
Free Pascal
var
a : array of array of integer;
b : array of integer;
s, i, j, n, m : integer;
begin
writeln('Введите кол-во строк:');
readln(m);
writeln('Введите кол-во столбцов:');
readln(n);
randomize;
setlength(a, n);
setlength(b, m);
for i:=0 to n-1 do
setlength(a[i], m);
for j:=0 to m-1 do begin
s:=0;
for i:=0 to n-1 do begin
a[i,j] := random(50) - 25;
if a[i,j] <0 then inc(s);
write(a[i, j], ' ');
end;
b[j]:=s;
writeln();
end;
writeln('--------------------------');
for j:=0 to m-1 do
writeln(j+1,' строка = ', b[j]);
end.
##
var n := ReadInteger;
var a := ArrRandom(n, -28, 27);
a.Println.Where(t -> t.Divs(3)).Product.Print