#include <stdio.h>
#define SIZE 10
double stack[SIZE];
int sp;
void push(double value);
double pop(void);
int isFull(void);
int isEmpty(void);
void answer(void);
void reset(void);
int main(void)
{
reset();
while(1){
int resp;
double data,number1,number2;
if(resp==9)
break;
else
switch(resp){
case 5: scanf("%lf",&data
); push(data);
break;
case 1: number1=pop();
number2=pop();
push(number2+number1);
break;
case 2: number1=pop();
number2=pop();
push(number2-number1);
break;
case 3: number1=pop();
number2=pop();
push(number2*number1);
break;
case 4: number1=pop();
number2=pop();
push(number2/number1);
break;
}
}
answer();
return 0;
}
void push(double value)
{
if(isFull()==0)
stack[sp++]=value;
else;
}
double pop(void)
{
if(isEmpty()==0)
return stack[--sp];
else
return 0;
}
int isFull(void)
{
if(sp>=SIZE)
return 1;//空きがあるなら0ないなら1を返す
else
return 0;
}
int isEmpty(void)
{
if(sp<=0)//空なら1空でないなら0を返す
return 1;
else
return 0;
}
void answer(void)
{
}
void reset(void)
{
int i;
for(i=0;i<=SIZE-1;i++)
stack[i]=0;
sp=0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgojZGVmaW5lIFNJWkUgMTAKZG91YmxlIHN0YWNrW1NJWkVdOwppbnQgc3A7Cgp2b2lkIHB1c2goZG91YmxlIHZhbHVlKTsKZG91YmxlIHBvcCh2b2lkKTsKaW50IGlzRnVsbCh2b2lkKTsKaW50IGlzRW1wdHkodm9pZCk7CnZvaWQgYW5zd2VyKHZvaWQpOwp2b2lkIHJlc2V0KHZvaWQpOwoKaW50IG1haW4odm9pZCkKewoJcmVzZXQoKTsKCXdoaWxlKDEpewoJCWludCByZXNwOwoJCWRvdWJsZSBkYXRhLG51bWJlcjEsbnVtYmVyMjsKCQkKCQlzY2FuZigiJWQiLCZyZXNwKTsKCQkKCQlpZihyZXNwPT05KQoJCWJyZWFrOwoJCQoJCWVsc2UKCQlzd2l0Y2gocmVzcCl7CgkJCWNhc2UgNTogc2NhbmYoIiVsZiIsJmRhdGEpOwoJCQkgICAgICAgIHByaW50Zigi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