#include<iostream>using namespace std;int main(){ int a,b,sum; char choice,end; cout<<"enter a,b:"; cin>>a; cin>>b; cout<<"your choice(+,-,*,/):"; cin>>choice; switch(choice) { case '+': sum=a+b; //cout<<"加法运算:sum="<<sum<<endl; break; case '-': if(a>b) sum=a-b; else sum=b-a; //cout<<"减法运算:sum="<<sum<<endl; break; case '*': sum=a*b; //cout<<"乘法运算:sum="<<sum<<endl; break; case '/': sum=a/b; //cout<<"除法运算:sum="<<sum<<endl; break; } cout<<"sum="<<sum<<endl; cout<<"please enter any key to exit\n"; cin>>end;}