код: unit Unit5;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm5 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
Label4: TLabel;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
x,y,z:Real;
implementation
{$R *.dfm}
procedure TForm5.Button1Click(Sender: TObject);
begin
If RadioButton1.Checked then
y:=StrToFloat(Edit2.Text);
z:=StrToFloat(Edit3.Text);
x:=z-y;
Edit1.Text:=FloatToStr(x)
else if RadioButton2.Checked then
x:=StrToFloat(Edit1.Text);
z:=StrToFloat(Edit3.Text);
y:=z-x;
Edit2.Text:=FloatToStr;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm5 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
Label4: TLabel;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
x,y,z:Real;
implementation
{$R *.dfm}
procedure TForm5.Button1Click(Sender: TObject);
begin
If RadioButton1.Checked then
y:=StrToFloat(Edit2.Text);
z:=StrToFloat(Edit3.Text);
x:=z-y;
Edit1.Text:=FloatToStr(x)
else if RadioButton2.Checked then
x:=StrToFloat(Edit1.Text);
z:=StrToFloat(Edit3.Text);
y:=z-x;
Edit2.Text:=FloatToStr;
end;
end.