#include <stdio.h>   
#include <stdlib.h>   
#include <ctype.h> 

#define MAXOP 100   
#define NUMBER '0'   
int getop (char []);   
void push (double);   
double pop(void);  
int getch(void);   
void ungetch(int);  
  
int main() {   
int type;   
double op;   
char s[MAXOP];   
while ((type=getop(s))!=EOF) {   
    switch(type){   
        case NUMBER:   
            push(atof(s));
            break;   
        case '+':   
            push(pop()+pop());   
            break;   
        case '*':   
            push(pop()*pop());   
            break;   
        case '-':   
            op=pop();   
            push(pop()-op);   
            break;   
        case '/':   
            op=pop(); 
            push(pop()/op);   
            break;   
        case '\n':   
            printf("%.8g\n",pop());   
            return 0;  
        default: break;   
        }   
    }   
return   0;   
}   
  
#define AAA 100   

int sp=0;   
double  val[AAA];   
  
void push(double f) {   
    if(sp<AAA)   
        val[sp++]=f;    
} 

double pop(void) {   
    if (sp>0) return val[--sp];   
}  
    
int getop(char s[]) {   
    int   i,c;   
    while   ((s[0]=c=getch())==' '|| c=='\t');   
        s[1]='\0';   
    if(!isdigit(c))   
        return c;   
    i=0;   
    if(isdigit(c))   
        while (isdigit(s[++i]=c=getch()));   
    if(c!=EOF)   
        ungetch(c);   
    return NUMBER;   
}   
 
#define BUFSIZE 100   
char buf[BUFSIZE];   
int bufp=0; 

int getch(void) {   
    return(bufp>0) ? buf[--bufp]:getchar();   
}

void ungetch(int c) {   
    buf[bufp++]=c;   
}
