Показать сообщение отдельно
  #5  
Старый 23.01.2012, 21:45
Kate23 Kate23 вне форума
Прохожий
 
Регистрация: 22.01.2012
Сообщения: 5
Репутация: 10
По умолчанию

PHP код:
unit Unit15;

interface

uses
  Windows
MessagesSysUtilsVariantsClassesGraphicsControlsForms,
  
DialogsStdCtrlsGrids,Math;

type
  TForm1 
= class(TForm)
    
Edit1TEdit;
    
Edit2TEdit;
    
Label1TLabel;
    
Label2TLabel;
    
StringGrid1TStringGrid;
    
StringGrid2TStringGrid;
    
Button1TButton;
    
procedure Button1Click(SenderTObject);
  private
    { Private 
declarations }
  public
    { Public 
declarations }
  
end;

var
  
Form1TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(SenderTObject);
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-do
for 
:= 0 to m-do
a[i,j]:=Round(sin(Random(100))*100);
StringGrid1.RowCount:=n+1;
StringGrid1.ColCount:=m+1;
with stringGrid1 do
Begin
i
:=0;
for 
:= 1 to RowCount do
Cells[i,j]:=InttoStr(j);
j:=0;
for 
:= 1 to ColCount do
Cells[i,j]:=IntToStr(i);
end;
with StringGrid1 do
for 
:= 1 to n do
for 
:= 1 to m do
Cells[j,i]:=Inttostr(a[i-1,j-1]);

begin
for := 1 to m-do
begin
max 
:= a[0,0];
for 
:= 0 to n-do if a[i,j]>max then max:=a[i,j];
end;
  
begin
max
:=0;
end;
for 
:= 1 to n do
for 
:= 1 to m do
end;
with stringGrid2 do
Begin
i
:=0;
for 
:= 1 to RowCount do
Cells[i,j]:=InttoStr(j);
j:=0;
for 
:= 1 to ColCount do
Cells[i,j]:=IntToStr(i);
end;
with StringGrid2 do
for 
:= 1 to n do
for 
:= 1 to m do
Cells[j,i]:=Inttostr(a[i,j]);
end;
end
не решает....
Ответить с цитированием