不开O2 就能过
开O2就RE
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxn = 1010;
char c[maxn];
int st[maxn];
bool comp(char *c)
{
int i = 0;
int now = 0;
int top = 0;
while(c[i]!='@')
{
if(c[i]>='0' && c[i]<='9')
{
now*=10;
now+=c[i] - '0';
}
else if(c[i] == '.')
{
st[++top] = now;
now = 0;
}
else if(c[i] == '+')
{
st[top-1] = st[top-1] + st[top];
st[top] = 0;
top--;
}
else if(c[i] == '-')
{
st[top-1] = st[top-1] - st[top];
st[top] = 0;
top--;
}
else if(c[i] == '*')
{
st[top-1] = st[top-1] * st[top];
st[top] = 0;
top--;
}
else if(c[i] == '/')
{
st[top-1] = st[top-1] / st[top];
st[top] = 0;
top--;
}
i++;
}
}
signed main()
{
scanf("%s",c);
comp(c);
printf("%lld\n",st[1]);
return 0;
}