var a:array [1..100,1..100] of Integer;
n,p,m,i,j,s:integer;
begin
n:=StrToInt(edt1.Text);
m:=StrToInt(edt2.Text);
strngrd1.RowCount:=n;
strngrd1.ColCount:=m;
s:=0;
p:=1;
randomize;
for i:=1 to n do
begin
a[i,j]:=Random(10);
strngrd1.Cells[j-1,i-1]:=IntToStr(a[i]);
s:=p*a[i];
end;
for j:=1 to m do
if a[i] < 0 then
begin
p:=p*a[i];
end;
end.