提交时间:2024-08-21 14:57:10

运行 ID: 180507

#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; }