题解
2025-09-10 21:47:50
发布于:湖北
2阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
stack <int> x;
int a,b;
char c;
int main(){
cin>>a;
int m=10000;
a=a%m;
x.push(a);
while(cin>>c>>b){
if(c=='*'){
a=x.top();
x.pop();
x.push(a*b%m);
}
else x.push(b);
}
a=0;
while(x.size()){
a+=x.top();
a%=m;
x.pop();
}
cout<<a<<endl;
return 0;
}
这里空空如也
有帮助,赞一个