
23.01.2012, 21:45
|
Прохожий
|
|
Регистрация: 22.01.2012
Сообщения: 5
Репутация: 10
|
|
PHP код:
unit Unit15;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids,Math;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
StringGrid1: TStringGrid;
StringGrid2: TStringGrid;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i,j,n,m,max:integer;
a:array[0..30,0..30]of integer;
begin
Randomize;
n:=strtoint(Edit1.Text);
m:=strtoint(Edit1.Text);
for i:=0 to n-1 do
for j := 0 to m-1 do
a[i,j]:=Round(sin(Random(100))*100);
StringGrid1.RowCount:=n+1;
StringGrid1.ColCount:=m+1;
with stringGrid1 do
Begin
i:=0;
for j := 1 to RowCount do
Cells[i,j]:=InttoStr(j);
j:=0;
for i := 1 to ColCount do
Cells[i,j]:=IntToStr(i);
end;
with StringGrid1 do
for i := 1 to n do
for j := 1 to m do
Cells[j,i]:=Inttostr(a[i-1,j-1]);
begin
for j := 1 to m-1 do
begin
max := a[0,0];
for i := 0 to n-1 do if a[i,j]>max then max:=a[i,j];
end;
begin
max:=0;
end;
for i := 1 to n do
for j := 1 to m do
end;
with stringGrid2 do
Begin
i:=0;
for j := 1 to RowCount do
Cells[i,j]:=InttoStr(j);
j:=0;
for i := 1 to ColCount do
Cells[i,j]:=IntToStr(i);
end;
with StringGrid2 do
for i := 1 to n do
for j := 1 to m do
Cells[j,i]:=Inttostr(a[i,j]);
end;
end.
не решает....
|