unit Unit3; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids, Math; type TForm3 = class(TForm) Edit1: TEdit; Edit2: TEdit; Button1: TButton; Button2: TButton; StringGrid1: TStringGrid; Button3: TButton; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; Const n1=50; m1=50; min=1000; Max=0; var Form3: TForm3; n,m,i,j:integer; implementation {$R *.dfm} procedure TForm3.Button1Click(Sender: TObject); begin Close; end; procedure TForm3.FormCreate(Sender: TObject); begin n:=4; //число строк в массиве m:=4; //число столбцов в массиве Edit1.Text:=''; Edit2.Text:=''; StringGrid1.Cells[0,0]:='I/J'; for i:=1 to n do StringGrid1.Cells[0,i]:='i='+IntToStr(i); for j:=1 to m do StringGrid1.Cells[j,0]:='j='+IntToStr(j); end; procedure TForm3.Button2Click(Sender: TObject); var i,j:integer; begin n:=StrToInt(Edit1.Text); //ввод переменной n m:=StrToInt(Edit2.Text); //ввод переменной m StringGrid1.RowCount:=n+1; //задание числа строк и столбцов в массиве StringGrid1.ColCount:=m+1; for i:=1 to n do StringGrid1.Cells[0,i]:='i='+IntToStr(i); for j:=1 to m do StringGrid1.Cells[j,0]:='j='+IntToStr(j); randomize; for i:=1 to n do for j:=1 to m do stringgrid1.cells[i,j]:=inttostr(random (100)-50); end; procedure TForm3.Button3Click(Sender: TObject); var max:integer; begin max:=strtoint(StringGrid1.Cells[1,1]); if StringGrid1.Cells[j,1] > max end; end.