c++builbder6.0计算器编程

来源:百度知道 编辑:UC知道 时间:2024/09/28 12:46:52
我只能说谢谢这位大侠了!!!!

不知道你想要什么样的,给你个简单计算器,不知道能否帮到你。。
{
double a,b,c;
if (Edit1||Edit2->Text==NULL)
{
ShowMessage("Please enter a number");
}
else
a=this->Edit1->Text.ToDouble();
b=this->Edit2->Text.ToDouble();

if (this->RadioButton1->Checked)
{
c=a+b;
}
if (this->RadioButton2->Checked)
{
c=a-b;
}
if (this->RadioButton3->Checked)
{
c=a*b;
}
if (this->RadioButton4->Checked)
{
if (b==0)
{
ShowMessage("Devide by 0 is not allow");
}
else
{
c=a/b;
}
}
this->Label1->Caption=c;
}

计算器?加减乘除功能乘方不都有了吗,这些功能可以直接实现撒