提交时间:2024-08-21 11:06:33

运行 ID: 178059

#include<bits/stdc++.h> using namespace std; long long a,b[100001],ss,l,s1; char s; int main(){ cin>>a; b[++ss]=a%10000; while(cin>>s>>a) if(s=='*') { l=(b[ss]*(a%10000))%10000; b[ss]=l; } else b[++ss]=a%10000; for(int i=1;i<=ss;i++) s1=(s1+b[i])%10000; cout<<s1; return 0; }