#include<iostream.h>
void main()
{
double a, b,result;
char type;
cout<<"请输入要预算的两数及运算类型";
cin<<a;
cin<<b;
cin<<type;
if(type=="+")
result=a+b;
else if(type=="-")
result=a-b;
else if(type=="*")
result=a*b;
else if(type=="/")
result=a/b;
else cout<<"Data Error.";
cout<<"The result is:";
cout<<result<<endl;
}
温馨提示:内容为网友见解,仅供参考