09/03/15 17:57:16
>>248 parseあんま自信無いw
#include<stdio.h>
#include<ctype.h>
int s[99],p,a;
void push(int n){s[p++]=n;}
int pop(void){return s[--p];}
int main(){
 int c,t;
 for(;(c=getchar())!=EOF&&c!='\n';){
  if(isspace(c));
  else if(c=='+')t=pop(),push(pop()+t);
  else if(c=='-')t=pop(),push(pop()-t);
  else if(c=='*')t=pop(),push(pop()*t);
  else if(c=='/')t=pop(),push(pop()/t);
  else if(ungetc(c,stdin),scanf("%d",&t)==1)push(t);
  else return fprintf(stderr,"Parse error!");
 }
 printf("%d\n",pop());
}