| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 125006 | 黄曦 | 简单计算器 | C++ | Accepted | 100 | 0 MS | 248 KB | 383 | 2024-01-23 16:18:23 |
#include<cstdio> #include<iostream> using namespace std; int main() { int a,c; char b; cin>>a>>b>>c; switch (b) { case '+': cout<<a+c;break; case '-': cout<<a-c;break; case '*': cout<<a*c;break; case '/': switch(c){case 0: cout<<"Divided by zero!";break; default:cout<<a/c;break;}break; default: cout<<"Invalid operator!"; } }