提交时间:2026-02-04 01:34:42

运行 ID: 83917

#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; }