提交时间:2026-01-04 17:40:31
运行 ID: 81392
#include <bits/stdc++.h> using namespace std; int main(){ int a, b; char ch; cin>>a>>b>>ch; if(ch=='+'){ cout<<a+b; }else if(ch=='-'){ cout<<a-b; }else if(ch=='*'){ cout<<a*b; }else if(ch=='/'){ if(b==0){ cout<< "Divided by zero!"; }else{ cout<<a/b;} }else{ cout<<"Invalid operator!"; }return 0; }