急救!!
#include<iostream>#include<string>
using namespace std;
void maid()
{ cout<<"请输入简单的算术表达式:";
int leftoperand,rightoperand;
char Operator;
cin>>leftoperand>>Operator>>rightoperand;
int result;
switch(Operator)
{case'+':
result=leftoperand+rightoperand;
break;
case'-':
result=leftoperand-rightoperand;
break;
case'*':
result=leftoperand*rightoperand;
break;
case '/':
if(rightoperand!=0)
result=leftoperand/rightoperand;
else
{ cout<<"除数为0,除法不能进行。"<<endl;
return;
}
break;
default:
cout<<Operator<<"是本程序不支持的操作。"<<endl;
return;
}
cout<<leftoperand<<" "<<Operator<<" "<<rightoperand<<"="<<result<<endl;
}
请问这个在VC++里编译的可是编译时没有错误一运行就有2个错误,这是为什么啊
请高手指教