implementation
//PROGRAM D9R1
//Driver for routine MNBRAK
uses
unit2;
{$R *.DFM}
Function FUNC(X:real):real;
begin
FUNC:= BESSJ0(X);
end;
procedure TForm1.Button1Click(Sender: TObject);
const
s1='%14.6f';
var
F:TextFile;
I:integer; AX,BX,CX,FA,FB,FC:real;
begin
//输出计算结果到文件
AssignFile(F, 'd:\delphi_shu\p9\d9r1.dat');
Rewrite(F);
For I:=1 To 10 do
begin
AX:= I * 0.5;
BX:=(I + 1)*0.5;
MNBRAK(AX,BX,CX,FA,FB,FC);
Writeln(F, ' A B C');
Writeln(F,' ', 'X',Format(S1,[AX]),Format(S1,[BX]),Format(S1,[CX]));
Writeln(F,' ', 'F',Format(S1,[FA]),Format(S1,[FB]),Format(S1,[FC]));
end;
CloseFile(F);
//屏幕显示计算结果
memo1.Lines.LoadFromFile('d:\delphi_shu\p9\d9r1.dat');
end;