问天 @ 2018-10-09 12:53:56
#include<bits/stdc++.h>
using namespace std;
stack<int>num;
int x1,x2;
int main()
{
char sx;
for(;;)
{
cin>>sx;
if(sx=='@')
break;
if(sx>='0'&&sx<='9')
num.push(sx-'0');
else if(sx=='.')
continue;
else
{
x1=num.top();
num.pop();
x2=num.top();
num.pop();
if(sx=='+')
num.push(x1+x2);
else if(sx=='*')
num.push(x1*x2);
else if(sx=='/')
num.push(x2/x1);
else
num.push(x2-x1);
}
}
cout<<num.top();
return 0;
}