#include <iostream>
#include<stack>
#include<cstdio>
using namespace std;
int main()
{
stack<int >st;
int s=0,a,b;
char c;
while(c!='@'){
c=getchar();
switch(c){
case '-':{
a=st.top();
st.pop();
b=st.top();
st.pop();
st.push(b-a);
break;
}
case '+':{
a=st.top();
st.pop();
b=st.top();
st.pop();
st.push(b+a);
break;
}
case '*':{
a=st.top();
st.pop();
b=st.top();
st.pop();
st.push(b*a);
break;
}
case '/':{
a=st.top();
st.pop();
b=st.top();
st.pop();
st.push(b/a);
break;
}
case '.':{
st.push(s);
s=0;
break;
}
default:{
s=s*10+c-'0';
}
}
}
s=st.top();
printf("%d\n",s);
return 0;
}
用栈非常好做,但是当时没看出来……