unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    StringGrid1: TStringGrid;
    Memo1: TMemo;
    Memo2: TMemo;
    Label3: TLabel;
    Label4: TLabel;
    Button2: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
   
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  const
  Nmax=10;
  Type
  Mas2=array[1..Nmax, 1..Nmax] of extended;
  Mas1=array[1..Nmax] of extended;

var
  s,p:Extended;
  Form1: TForm1;
  A,B:Mas2;
  N,M,i,j:integer;

implementation
{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
N:=3;
M:=3;
Edit1.text:= floattostr(N);
Edit2.Text:= Floattostr(M);
Memo1.Clear;
Memo2.Clear;

StringGrid1.RowCount:=N+1;
stringGrid1.ColCount:=M+1;

stringgrid1.Cells[0,0]:='Массив А:';

For i:=1 to N do begin
stringgrid1.Cells[0,i]:='i='+inttostr(i);
stringgrid1.Cells[i,0]:='j='+inttostr(i);
end;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
for i:=1 to N do
for j:=1 to M do
A[i,j]:=StrtoFloat(stringgrid1.Cells[j,i]);

p:=1;

for i:=2 to n do
for j:=n-i+2 to n do


   p:=p*A[i,j];
   Memo2.Lines.Add(FloatToStr(p))


end;

procedure TForm1.Button1Click(Sender: TObject);
begin
{$R+}

for i:=1 to N do
for j:=1 to M do
A[i,j]:=StrtoFloat(stringgrid1.Cells[j,i]);

for i:=1 to N do
for j:=1 to M do
 if i<j then
 s:=S+A[i,j];
 Memo1.Lines.Add(FloatToStr(s));

end;
end.
