Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
119303 陈星云 表达式求值 C++ Wrong Answer 10 22 MS 456 KB 329 2024-01-05 13:41:39

Tests(1/10):


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


Judgement Protocol: