Дорого времени суток!
Смотрите код:
[code lang=pascal]unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Grids;
type
{ TForm1 }
TForm1 = class(TForm)
StringGrid1: TStringGrid;
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
var
i,j,ij,ii:integer;
begin
randomize;
for i:=0 to Form1.StringGrid1.ColCount-1 do
for j:=0 to Form1.StringGrid1.RowCount-1 do
Form1.StringGrid1.Cells[i,j]:=IntToStr(random(99));
ii:=0;
ij:=Form1.StringGrid1.RowCount-1;
for i:=0 to Form1.StringGrid1.ColCount-1 do
if StrToInt(Form1.StringGrid1.Cells[i,Form1.StringGrid1.RowCount-i-1])<
StrToInt(Form1.StringGrid1.Cells[ii,ij]) then
begin
ii:=i;
ij:=Form1.StringGrid1.RowCount-i-1;
end;
Form1.Caption:='min:='+Form1.StringGrid1.Cells[ii,ij]+
' col:='+IntToStr(ii)+
' row:='+InttoStr(ij);
end;
end.[/code]
Создаете форму как на рисунке:
Разные запуски дают разные результаты.
Удачи!
Об авторе:
Мне безразлично, что Вы думаете о обо мне, но я рад за Вас - Вы начали думать.