用Visual studio2010 写个计算器的程序,输出两个数,能加减乘除,跪求啊,我是c++的新手不会弄啊

完整的一套程序,我想学一学
求自己写的,别复制粘贴。。。

#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;
}
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答