Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
125112 林麒瑞 简单计算器 C++ Compile Error 0 0 MS 0 KB 350 2024-01-23 16:26:21

Tests(0/0):


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


Judgement Protocol: