代码: procedure TForm1.SpeedButton2Click(Sender: TObject); var i:double; x:double; y:double; m:double; n:double; begin i:=strtofloat(edit1.text); if edit1.Text=' then showmessage('请输入操作数') else if radiobutton1.Checked then begin x:=sin(i); edit2.text:=floattostr(x); end else if radiobutton2.Checked then begin y:=cos(i); edit2.text:=floattostr(y); end else if radiobutton3.Checked then begin edit2.text:=floattostr(i*i); end else if radiobutton4.Checked then begin if i<=0 then showmessage('请输入正数') else m:=sqrt(i); edit2.Text:=floattostr(m); end else if radiobutton5.Checked then begin n:=Exp(i); edit2.Text:=floattostr(n); end; end;
----------------------------------------------
songchan