#include<bits/stdc++.h>
using namespace std;
string str;
stack<int> s;
int a,b;
int main(){
cin>>str;
for(int i=0;i<str.size();i++){
if(str[i]=='@'){
break;
}else if(str[i]<='9'&&str[i]>='1'){
s.push(str[i]);
// cout<<str[i]<<" ";
}else if(str[i]=='.'){
continue;
}else{
if(str[i]=='+'){
a=s.top();
s.pop();
b=s.top();
s.pop();
// cout<<"1"<<" "<<a+b<<endl;
s.push(a+b);
}else if(str[i]=='-'){
a=s.top();
s.pop();
cout<<s.top();
b=s.top();
cout<<b<<" ";
s.pop();
// cout<<"2"<<" "<<b-a<<endl;
s.push(b-a);
// for(int i=0;i<s.size();i++) cout<<s[i]<<" ";
// cout<<endl;
}else if(str[i]=='*'){
a=s.top();
s.pop();
b=s.top();
s.pop();
s.push(a*b);
// cout<<3<<" "<<a<<" "<<b<<endl;
// cout<<"3"<<" "<<a*b<<endl;
}else if(str[i]=='/'){
a=s.top();
s.pop();
b=s.top();
s.pop();
s.push(b/a);
// cout<<"4"<<" "<<b/a<<endl;
}
}
}
cout<<s.top();
return 0;
}
样例没过
输入样例: 3.5.2.-*7.+@
输出结果:208
正确结果:16
编号:p1149