Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
5839 石利伟 简单计算器 C++ 解答错误 0 0 MS 244 KB 274 2020-08-15 09:08:40

Tests(0/1):


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


测评信息: