帮忙决绝一个问题
#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;
}
这里有一处错可是我找不找请高手帮帮