procedure TForm1.FormCreate(Sender: TObject);
begin
stringGrid1.Cells[1,1]:='5,02';
stringGrid1.Cells[1,2]:='57';
stringGrid1.Cells[1,3]:='33';
stringGrid1.Cells[1,4]:='13';
stringGrid1.Cells[1,5]:='1';
stringGrid1.Cells[2,1]:='4,7';
stringGrid1.Cells[2,2]:='-100';
stringGrid1.Cells[2,3]:='-5';
stringGrid1.Cells[2,4]:='-14';
stringGrid1.Cells[2,5]:='-2';
stringGrid1.Cells[3,1]:='-7';
stringGrid1.Cells[3,2]:='86';
stringGrid1.Cells[3,3]:='66';
stringGrid1.Cells[3,4]:='17';
stringGrid1.Cells[3,5]:='0,5';
stringGrid1.Cells[4,1]:='-19';
stringGrid1.Cells[4,2]:='17';
stringGrid1.Cells[4,3]:='9';
stringGrid1.Cells[4,4]:='-8';
stringGrid1.Cells[4,5]:='16';
stringGrid1.Cells[5,1]:='-32';
stringGrid1.Cells[5,2]:='9';
stringGrid1.Cells[5,3]:='18';
stringGrid1.Cells[5,4]:='15';
stringGrid1.Cells[5,5]:='70';
stringGrid1.Cells[6,1]:='82';
stringGrid1.Cells[6,2]:='4';
stringGrid1.Cells[6,3]:='-7';
stringGrid1.Cells[6,4]:='14';
stringGrid1.Cells[6,5]:='17';
stringGrid1.Cells[7,1]:='0,3';
stringGrid1.Cells[7,2]:='-10';
stringGrid1.Cells[7,3]:='5';
stringGrid1.Cells[7,4]:='5';
stringGrid1.Cells[7,5]:='16';
stringGrid2.Cells[1,1]:='5,02';
stringGrid2.Cells[1,2]:='57';
stringGrid2.Cells[1,3]:='33';
stringGrid2.Cells[1,4]:='13';
stringGrid2.Cells[1,5]:='1';
stringGrid2.Cells[2,1]:='4,7';
stringGrid2.Cells[2,2]:='-100';
stringGrid2.Cells[2,3]:='-5';
stringGrid2.Cells[2,4]:='-14';
stringGrid2.Cells[2,5]:='-2';
stringGrid2.Cells[3,1]:='-7';
stringGrid2.Cells[3,2]:='86';
stringGrid2.Cells[3,3]:='66';
stringGrid2.Cells[3,4]:='17';
stringGrid2.Cells[3,5]:='0,5';
stringGrid2.Cells[4,1]:='-19';
stringGrid2.Cells[4,2]:='17';
stringGrid2.Cells[4,3]:='9';
stringGrid2.Cells[4,4]:='-8';
stringGrid2.Cells[4,5]:='16';
stringGrid2.Cells[5,1]:='-32';
stringGrid2.Cells[5,2]:='9';
stringGrid2.Cells[5,3]:='18';
stringGrid2.Cells[5,4]:='15';
stringGrid2.Cells[5,5]:='70';
stringGrid2.Cells[6,1]:='82';
stringGrid2.Cells[6,2]:='4';
stringGrid2.Cells[6,3]:='-7';
stringGrid2.Cells[6,4]:='14';
stringGrid2.Cells[6,5]:='17';
stringGrid2.Cells[7,1]:='0,3';
stringGrid2.Cells[7,2]:='-10';
stringGrid2.Cells[7,3]:='5';
stringGrid2.Cells[7,4]:='5';
stringGrid2.Cells[7,5]:='16';
end;
procedure TForm1.Button1Click(Sender: TObject);
var
A:array[1..5,1..7]of real;
i,j:integer;
k,l:integer;
min:real;
begin
Min:=A[1,1];
for i:=1 to 5 do
for j:=1 to 7 do begin
If A[i,j]< Min then begin
Min:=A[i,j];
l:=j;
k:=i;
end;
end;
for i:=1 to 7 do begin
A[k,i]:=0;
StringGrid2.Cells[k,i]:='0';
end;
for j:=1 to 5 do begin
A[j,l]:=0;
StringGrid2.Cells[j,k]:='0';
end;
end;
end.