#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<stack>
using namespace std;
int zhan[1000000],top,t;
int a,b;
int main()
{
string s;
cin>>s;
for(int i=1;i<s.length()-1;i++)
{
if(s[i]>='0'&&s[i]<='9')
{
t=t*10+(s[i]-'0');
t=0;
}
if(s[i]=='.')
{
if(s[i]=='+')
{
b=zhan[--top];
a=zhan[--top];
zhan[t]=a+b;
}
if(s[i]=='-')
{
b=zhan[--top];
a=zhan[--top];
zhan[t]=a-b;
}
if(s[i]=='*')
{
b=zhan[--top];
a=zhan[--top];
zhan[t]=a*b;
}
if(s[i]=='/')
{
b=zhan[--top];
a=zhan[--top];
zhan[t]=a/b;
}
}
}
cout<<zhan[t]<<endl;
}
提交记录