Помогите пожалуйста! Делфи. Выдаёт ошибку в конце. (else)
unit Unit1;

interface

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

type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
edt1: TEdit;
Edit1: TEdit;
Edit2: TEdit;
Label4: TLabel;
Edit3: TEdit;
lbl1: TLabel;
edt2: TEdit;
lbl2: TLabel;
edt3: TEdit;
btn1: TButton;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
a,b,c,d,x1,x2:Double;

implementation

{$R *.dfm}

procedure TForm1.btn1Click(Sender: TObject);
begin
a:=StrToFloat(edt1.Text);
b:=StrToFloat(Edit1.Text);
c:=StrToFloat(Edit2.Text);
d:=Sqr(b)-4*a*c;
Edit3.Text:=FloatToStr(d);
if d>=0 then
x1:=(-b-sqrt(d))/2*a;
x2:=(-b+sqrt(d))/2*a;
edt2.Text:=FloatToStr(x1);
edt3.Text:=FloatToStr(x2);
else ShowMessage('Корней нет');
end;
end.
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.