Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
104182 | 夏梓瑞 | 22计算算术表达式 | C++ | Wrong Answer | 1 MS | 272 KB | 790 | 2025-01-04 14:43:06 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min()\fabs() #include<ctime> #include<cstdlib> using namespace std; int main(){ int n,o=0,b=0; char a; cin>>n; for(int i=1;i<=n;i++){ cin>>o>>a>>b; if(a=='+') cout<<o+b; else if(a=='-') cout<<o-b; else if(a=='*') cout<<o*b; else if(a=='/') cout<<o/b; else if(a=='%') cout<<o%b; } return 0; }
------Input------
5 5+4 3*7 8/3 9-9 12%2
------Answer-----
9 21 2 0 0
------Your output-----
921200