⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit3.pas

📁 SourceCode for Delphi. multiplex matrix
💻 PAS
字号:
unit Unit3;

interface

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

type
  vector=array [1..20,1..20] of real;
  TForm1 = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    StringGrid1: TStringGrid;
    Label3: TLabel;
    Button1: TButton;
    Button2: TButton;
    Label4: TLabel;
    procedure StringGrid1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  l:integer;

implementation

{$R *.dfm}

procedure max(vr:vector;var max:real);
 var i,j:integer;
 begin
  max:=1;
  for i:=1 to l do
  for j:=1 to l do
   if (vr[i,j]<>0) and (i<>j) and (j<>l-i+1) then
   max:=max* vr[i,j];
 end;

procedure TForm1.StringGrid1Click(Sender: TObject);
 begin
  stringgrid1.RowCount:=strtoint(edit1.Text);
  stringgrid1.ColCount:=strtoint(edit1.Text);
 end;

procedure TForm1.Button2Click(Sender: TObject);
 begin
  close();
 end;

procedure TForm1.Button1Click(Sender: TObject);
var
t:vector;
i,j:integer;
u:real;
 begin
  l:=strtoint(edit1.Text);
  for i:=1 to l do
   for j:=1 to l do
    if stringGrid1.Cells[j-1,i-1]<>'' then
    t[i,j]:=StrTofloat
   (StringGrid1.Cells[j-1,i-1]) else exit;
    max(t,u);
   label4.Caption:=floattostr(u);
 end;
 end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -