为什么会RE啊!
  • 板块学术版
  • 楼主Carlos20130721
  • 当前回复3
  • 已保存回复3
  • 发布时间2024/7/28 16:48
  • 上次更新2024/7/28 18:15:24
查看原帖
为什么会RE啊!
1325708
Carlos20130721楼主2024/7/28 16:48

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

2024/7/28 16:48
加载中...