Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
119308 陈星云 表达式求值 C++ 通过 100 19 MS 452 KB 372 2024-01-05 13:45:06

Tests(10/10):


#include <bits/stdc++.h> using namespace std; stack<int> x; int main() { int a,b; char c; cin>>a; a%=10000; x.push(a%10000); while(cin>>c>>b) { if(c=='*') { a=x.top(); x.pop(); x.push(a*b%10000); } else x.push(b); } a=0; while(x.size()) { a+=x.top(); a%=10000; x.pop(); } cout<<a%10000<<endl; return 0; }


测评信息: