#include <bits/stdc++.h> using namespace std; int getlevel(char op){ if(op=='#')return 0; else if(op=='$')return 1; else if(op=='+'||op=='-')return 2; else return 3; } double compute(double x,double y,char op){ if(op=='+')return x+y; else if(op=='-')return x-y; else if(op=='*')return x*y; else return x/y; } int main() { string s; //cout<<"yes"<<endl; while (getline(cin,s)) { // 注意 while 处理多个 case if(s.size()==1)break; stack<double> nums; stack<char> ops; ops.push('#'); s+='$'; //cout<<s<<endl; int n = s.size(); //cout<<"yes"<<endl; for(int i=0;i<n;){ if(s[i]==' '){ i++; continue; } if(s[i]>='0'&&s[i]<='9'){ //cout<<"yes"<<endl; double tem = 0; while(i<n&&s[i]>='0'&&s[i]<='9'){ tem=tem*10+s[i]-'0'; i++; } //cout<<tem<<endl; nums.push(tem); continue; }else{ //cout<<s[i]<<endl; if(getlevel(ops.top())<getlevel(s[i])){ ops.push(s[i]); i++; //cout<<s[i]<<endl; }else if(getlevel(ops.top())>=getlevel(s[i])){ double res = 0; char op = ops.top(); ops.pop(); //ops.push(s[i]); //cout<<s[i]<<endl; double b = nums.top(); nums.pop(); double a = nums.top(); nums.pop(); res = compute(a,b,op); //cout<<res<<endl; nums.push(res); } } } printf("%.2lf\n",nums.top()); } } // 64 位输出请用 printf("%lld")