unit uround;

interface

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

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Button1: TButton;
    Button2: TButton;
    Label2: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  r,c,s:real;
const pi=3.14159;     // 常量的定义
begin
r:=strtofloat(edit1.Text);
c:=2*pi*r;
s:=pi*sqr(r);
label2.Caption:='该圆的周长为：'+floattostr(c)+' '+chr(13)+'面积为:'+floattostr(s);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;

end.
