Procedure TForm1.btn1Click(Sender: TObject);
begin
n:=StrToInt(edt1. text);
strngrd1.RowCount:=n;
strngrd1.ColCount:=n;
Randomize;
for i:=0 to n-1 do
for j:=0 to n-1 do
begin
t[i, j]:=Random(100);
strngrd1. Cells[j, i]:=IntToStr(t[i, j]);
end;
min:=StrToInt(strngrd1. Cells[1, 1]);
for i:=0 to n-1 do
for j:=0 to n-1 do
if i=j then begin
if min>StrToInt(strngrd1. Cells[j, i]) then min:=StrToInt(strngrd1. Cells[j, i]); end;
lbl2.caption:='Minim='+inttostr(min);
end;