提交时间:2024-01-23 16:42:25

运行 ID: 125298

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