Код:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | unit Equation;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
var a,b,c: string ;
type
TForm1 = class (TForm)
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
Edit2: TEdit;
Label3: TLabel;
Edit3: TEdit;
Button1: TButton;
Button2: TButton;
Label4: TLabel;
Label5: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Memo1: TMemo;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
public
end ;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1 . Button1Click(Sender: TObject);
begin
a:=Edit1 . text;
b:=Edit2 . text;
c:=Edit3 . text;
end ;
procedure TForm1 . Button2Click(Sender: TObject);
var x1,x2: longint ;
begin
strtoint(a); strtoint(b); strtoint(c);
x1:=((-b+(sqrt(b*b- 4 *a*c)))/2a);
x1:=((-b-(sqrt(b*b- 4 *a*c)))/2a);
end ;
end .
|
Кто нибудь может сказать, где ошибка? Скриншот:
http://s11.radikal.ru/i183/0911/d7/ea7b19a74450.gif
ЗЫ: Я новичек, так что ногами не бейте, если что))