QDHSLGYYJK @ 2020-10-08 22:39:01
就是样例,本地输出16,洛谷是9
#include<cstdio>
using namespace std;
char ch;
int s[1007],l,num;
int main(){
for (ch=getchar();ch!='@';ch=getchar()){
if (ch>=48&&ch<=57){
num*=10;
num+=ch-48;
}
if (ch=='.'){
s[++l]=num;
num=0;
}
if (ch=='+')
s[--l]=s[l]+s[l+1];
if (ch=='-')
s[--l]=s[l]-s[l+1];
if (ch=='*')
s[--l]=s[l]*s[l+1];
if (ch=='/')
s[--l]=s[l]/s[l+1];
}
printf("%d",s[1]);
return 0;
}