提交时间:2024-08-21 15:38:30

运行 ID: 180527

#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(~scanf(" %c%lld",&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; }