#早上刚AC了此题,直接全部都是int型即可
AC代码:(抄袭?变棕吧!)
```cpp
#include<bits/stdc++.h>
using namespace std;
int a[1000],*top;
char s[1000];
void push(int x)
{
*top=*top+1;
a[*top]=x;
}
void pop()
{
a[*top]=0;
*top=*top-1;
}
int main()
{
top=&a[0];
scanf("%s",s);
int i=0,r=1,j,ans,y,z;
while(i<strlen(s))
{
if (s[i]=='.')
{
ans=0;
r=1;
j=i-1;
while(s[j]>='0'&&s[j]<='9'&&j>=0)
{
ans=ans+r*(s[j]-'0');
r=r*10;
j=j-1;
}
push(ans);
}
if (s[i]=='@')
{
cout<<a[1]<<endl;
return 0;
}
if (s[i]=='+')
{
y=a[*top];
z=a[*top-1];
pop();
pop();
push(y+z);
}
if (s[i]=='-')
{
y=a[*top];
z=a[*top-1];
pop();
pop();
push(z-y);
}
if (s[i]=='*')
{
y=a[*top];
z=a[*top-1];
pop();
pop();
push(y*z);
}
if (s[i]=='/')
{
y=a[*top];
z=a[*top-1];
pop();
pop();
push(z/y);
}
i=i+1;
}
}
```
by Luban @ 2019-01-21 17:47:46
数据都是整型吗?
by difficult @ 2019-05-19 11:19:50
@[Light_Of_Wisdom](/user/113600) tlqtj 烤谷*3
by y_kx_b @ 2022-08-22 11:34:44