Вот программа
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls,Form1.Show;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Button1: TButton;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
procedure FormCreate(Sender: TObject);
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
A,B,C:Real;
X1,X2,D:Real;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
D:=SQR(B)-4*A*C;
begin if D<0 then Form1.showModal;
X1:=(-B+SQRT(D)/2*A);
X2:=(-B-SQRT(D)/2*A);
end;
begin
A:=strToFloat(Edit1.Text);
B:=strToFloat(Edit2.Text);
C:=strToFloat(Edit3.Text);
end;
begin
Panel1.Caption:=FloatToStr(X1);
Panel2.Caption:=FloatToStr(X2);
Panel3.Caption:=FloatToStr(D);
end;
end;
end.