请帮我看一下简单计算器c++为什么80分?

简单计算器
    
题目描述
读入一个只包含+、-、*、/、的非负整数计算表达式,计算该表达式的值。

输入格式
测试数据有多组,每组占一行。

每行不超过200个字符,整数和运算符之间用一个空格分隔。

没有非法表达式。

当一行中只有一个0时,表示输入结束,相应的结果不要输出。

输出格式
对于每组测试数据输出一行,即该表达式的值,精确到小数点后两位。

样例
输入样例
30 / 90 - 26 + 97 - 5 - 6 - 13 / 88 * 6 + 51 / 29 + 79 * 87 + 57 * 92
0
输出样例
12178.21

我的代码:

#include <bits/stdc++.h>
using namespace std;
const int MAX = 200;
stack <double> s;
int main () {
    int a;
    while (scanf ("%d ", &a) && a != 0) {
        s.push (1.0 * a);
        char x, g;
        double y;
        double ans = 0;
        while (scanf ("%c %lf%c", &x, &y, &g) != EOF) {
            if (x == '+') {
                s.push (1.0 * y);
            } else if (x == '-')
                s.push (-1.0 * y);
            else if (x == '*') {
                double temp = s.top() * y;
                s.pop ();
                s.push (temp);
            } else if (x == '/') {
                double temp = s.top () / y;
                s.pop ();
                s.push (temp);
            }
            if (g != ' ') {
                break;
            }
        }
        while (! s.empty ()) {
            ans += s.top ();
            s.pop ();
        }
        printf ("%.2lf\n", ans);
    }
    return 0;
}

img

img