#include<bits/stdc++.h> usingnamespace std; stack<int> st; int a, b; char op; intmain() { cin >> a; a = a % 10000; // 在这一定要取模 st.push(a); while (cin >> op >> b) { if (op == '*') { a = st.top(); st.pop(); st.push(a * b % 10000); } else st.push(b); } int ans = 0; while (st.size()) { ans += st.top(); ans %= 10000; st.pop(); } cout << ans; return0; }