提交时间:2024-01-23 16:18:09
运行 ID: 125003
#include<iostream> #include<cstdio> using namespace std; int main() { int a,b; char c; cin>>a>>c>>b; switch(b) { case 0:cout<<"Divided by zero!" ;return 0; } switch(c) { case 43:cout<<a+b;break; case 45:cout<<a-b;break; case 42:cout<<a*b;break; case 47:cout<<a/b;break; default:cout<<"Invalid operator!"; } return 0; }