| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 131969 | 周荣浩 | 22计算算术表达式 | C++ | Wrong Answer | 2 MS | 272 KB | 332 | 2025-10-02 14:56:43 |
#include<bits/stdc++.h> using namespace std; int a[1001]; int main(){ int a,b,n; char c; cin>>n; while(n--){ cin>>a>>c>>b; if(c=='+') cout<<a+b<<endl; else if(c=='-') cout<<a+b<<endl; else if(c=='*') cout<<a*b<<endl; else if(c=='/') cout<<a/b<<endl; else if(c=='%') cout<<a%b<<endl; } return 0; }
------Input------
5 5+4 3*7 8/3 9-9 12%2
------Answer-----
9 21 2 0 0
------Your output-----
9 21 2 18 0