提交时间:2024-01-23 16:15:00

运行 ID: 124974

#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 char(43):cout<<a+b;break; case char(45):cout<<a-b;break; case char(42):cout<<a*b;break; case char(47):cout<<a/b;break; default :cout<<"Invalid operator!"; return 0; } }