>>717
適当適当適当

#include<stdio.h>
#include<ctype.h>
int main(){
    int c;
    int st[80];
    int*p=st;
    while((c=getchar())!=EOF){
        if(c=='\n')printf("%d\n",*--p),p=st;
        else if(isspace(c))continue;
        else if(isdigit(c))ungetc(c,stdin),scanf("%d",p++);
        else if(c=='N')ungetc('-',stdin),scanf("%d",p++);
        else if(c=='+')--p,p[-1]+=*p;
        else if(c=='-')--p,p[-1]-=*p;
        else if(c=='*')--p,p[-1]*=*p;
        else if(c=='/')--p,p[-1]/=*p;
        else if(c=='%')--p,p[-1]%=*p;
    }
    return 0;
}