提交时间:2024-01-23 16:46:37

运行 ID: 125340

#include<iostream> using namespace std; int main() { int a,c; char b; cin>>a>>b>>c; switch(c){ case 0:cout<<"Divided by zero!";return 0; } switch(b){ case'+': cout<<a+c;break; case'-': cout<<a-c;break; case'*': cout<<a*c;break; case'/': cout<<a/c;break; default: cout<<"Invalid operator!"; } return 0; }