tr,不是ctj,老师上课就这么讲的
#include<bits/stdc++.h>
using namespace std;
int main(){
char c;
stack<int>s;
int x,y;
cin>>x;
x%=10000;
s.push(x);
while(cin>>c>>y){
if(c=='*'){
int t=s.top();
s.pop();
s.push(t*y%10000);
}else s.push(y);
}
int ans=0;
while(s.size()){
ans+=s.top();
ans%=10000;
s.pop();
}
cout<<ans;
return 0;
}