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

运行 ID: 125347

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