procedure TForm1.Button1Click(Sender: TObject);
var
j,i,min,max:integer;
begin
min:=StrToInt(StringGrid1.Cells[j,i]);
min:=max;
For i:=1 to StringGrid1.RowCount-1 doFor j:=1 to StringGrid1.ColCount-1 do beginif StrToInt(StringGrid1.Cells[j,i])<min then
min:=StrToInt(StringGrid1.Cells[j,i]);
if StrToInt(StringGrid1.Cells[j,i])>max then
max:=StrToInt(StringGrid1.Cells[j,i]);
end;
Label4.Caption:=IntToStr(min);
Label3.Caption:=IntToStr(max);
end;