unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    CheckBox1: TCheckBox;
    Memo1: TMemo;
    RadioGroup1: TRadioGroup;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure Memo1KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
edit1.clear;
edit2.clear;
edit3.clear;
memo1.Clear;
memo1.Lines.add('ËÐ¹2.020601.Ùåðáàòþê');
radiogroup1.itemindex:=0;

end;

procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
var x,y,z,u,p:extended;
begin
if key=chr(13) then
begin
x:=strtofloat(edit1.text);
y:=strtofloat(edit2.text);
z:=strtofloat(edit3.text);
memo1.lines.add('x='+edit1.text);
memo1.lines.add('y='+edit2.text);
memo1.lines.add('z='+edit3.text);
case radiogroup1.itemindex of
0: u:=sinh(x);
1: u:=sqr(x);
2: u:=exp(x);
end;
p:=abs(min(u,y)-max(y,z))/2;
if checkbox1.checked then
memo1.Lines.add('p='+inttostr(round(p)))
else memo1.Lines.add(floattostrf(p,ffgeneral,8,3));
end;
end;

end.
