讨论 / c++超酷代码
Jabbar 2019-06-25 03:14:11
点我顶贴 收藏 删除
#include<bits/stdc++.h>

using namespace std;

int s[100005];

int main(){

int sh;

char k;int f;

int top=1;

cin>>sh;

s[top]=sh;

while(cin>>k){

cin>>f;

if(k=='*'){

s[top]*=f;

s[top]=s[top]%10000;

}

if(k=='+'){

top++;

s[top]=f;

s[top]=s[top]%10000;

}

}

int h=0;

for(int i=1;i<=top;i++){

h=h+s[i];

h%=10000;

}cout<<h<<endl;

return 0;

}

快去交!!!!!!!

查看更多回复
提交回复