Zoeli @ 2023-09-27 13:40:57
#include<bits/stdc++.h>
using namespace std;
int i,now,s[10009];
char a;
int c;
int main(){
while((c=getchar())!='@')
{
if(c>='0'&&c<='9'){
if(a==2){
i++;
a==0;
}
s[i]=(c-'0')+s[i]*10;
}
else if(c=='.'){
i++;
a=1;
}
else if(c=='+'){
if(a==1)
i--;
s[i-1]=s[i]+s[i-1];
s[i]=0;
i--;
a=2;
}
else if(c=='-'){
if(a==1)
i--;
s[i-1]=s[i-1]-s[i];
s[i]=0;
i--;
a=2;
}
else if(c=='/'){
if(a==1)
i--;
s[i-1]=s[i-1]/s[i];
s[i]=0;
i--;
a=2;
}
else if(c=='*'){
if(a==1)
i--;
s[i-1]=s[i]*s[i-1];
s[i]=0;
i--;
a=2;
}
}
cout<<s[0];
return 0;
}
by Sqj147 @ 2023-10-12 16:41:05
if(c>='0'&&c<='9'){
if(a==2){
i++;
a==0;// a = 0
}
s[i]=(c-'0')+s[i]*10;
}