?? unit1.pas
字號(hào):
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
RadioGroup1: TRadioGroup;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Panel2: TPanel;
Memo1: TMemo;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
const long=250;
type array1=array[1..long]of array[0..long] of real;
type array2=array[0..long]of array[0..long]of tedit;
var
Form1: TForm1;
m,n:integer;
a:array1;
b:array[1..long]of real;
implementation
uses Unit2;
var shuru:array2;
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
var
i,j:integer;
begin
if(edit1.Text<>'')and(edit2.Text<>'') then
begin
try
for i:=1to m+1 do
for j:=1 to n+2 do
shuru[i,j].Free;
finally
m:=0;n:=0;
m:=strtoint(edit1.Text);
n:=strtoint(edit2.Text);
for i:=1 to m+1 do
for j:=1 to n+2 do
begin
shuru[i,j]:=tedit.Create(self);
shuru[i,j].Parent:=panel2;
shuru[i,j].Width:=40;
shuru[i,j].Left:=30+(j-1)*shuru[i,j].Width;
shuru[i,j].Top:=30+(i-1)*shuru[i,j].Height;
end;
end;
shuru[1,1].SetFocus;
bitbtn2.Enabled:=true;
end
else showmessage('條件不夠,請(qǐng)重新輸入!');
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
var i,j:integer;
opt:array[1..long]of integer;
begin
for i:=1to long do
for j:=0 to long do a[i,j]:=0;
for i:=1 to long do b[i]:=0;
for i:=1 to long do opt[i]:=0;
for i:=1 to m+1 do
begin
if shuru[i,n+2].Text<>'' then a[i,0]:=strtofloat(shuru[i,n+2].text);
if shuru[i,n+1].Text<>'' then opt[i]:=strtoint(shuru[i,n+1].text);
for j:=1 to n do
if shuru[i,j].Text<>'' then
a[i,j]:=strtofloat(shuru[i,j].Text);
end;
if radiogroup1.Items[radiogroup1.ItemIndex]='max' then
for j:=1 to n do
a[m+1,j]:=-a[m+1,j];
leixing:=radiogroup1.Items[radiogroup1.itemindex];
for i:=1 to m do
a[i,n+i]:=1;
for j:=1 to n do
b[j]:=a[m+1,j];
form2.Show;
form2.BitBtn4.Enabled:=true;
end;
end.
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -