unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var zahl: integer;
a,b,Genauigkeit:real;
begin
zahl := strtoint(edit1.text);
Genauigkeit := strtofloat(edit2.text);
a:=1; b:=zahl;
repeat
b:=(a+b)/2;
a:=zahl/b
until
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
end.