выдает ряд ошибок про не согласование типов
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Grids;
type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
Edit1: TEdit;
Label1: TLabel;
Edit2: TEdit;
Label2: TLabel;
Button1: TButton;
Button2: TButton;
Edit3: TEdit;
Label3: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1; n,m:integer; A:array of array of real;
f:boolean;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
Var i:integer;
begin
f:=true;
n:=StrToInt(Edit1.Text); m:=StrToInt(Edit2.Text);
StringGrid1.ColCount:=m+1;
StringGrid1.RowCount:=n+1;
for i:=1 to n do
StringGrid1.Cells[0,i]:=IntToStr(i);
for i:=1 to m do
StringGrid1.Cells[i,0]:=IntToStr(i);
end;
procedure TForm1.Button2Click(Sender: TObject);
Var i,j,k:integer; S:real;
begin
if not f then
showmessage('не ввели n,m')
else
begin
SetLength(a,n,m);
S:=0;
k:=0;
for i:=0 to n-1 do
for j:=0 to m-1 do
Begin
if StringGrid1.Cells[j+1,i+1]='' then
a[i,j]:=0
else
a[i,j]:=StrToFloat(StringGrid1.Cells[j+1,i+1]);
for j=m-1 do
for i=0 to n-1 do
if a[i,j]:=1 then
begin
S:=S+a[i,j];
k:=k+1;
end;
S:=S/k;
End;
Edit3.text:=FloatToStr(S);
end
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
f:=false;
Edit1.Text:='';
Edit2.Text:='';
Edit3.Text:='';
end;
end.