C++转换为C语言的一段程序


while (true)
    {
        cin >> str;//输入
        ch = str[0];
        if (ch == '=')
            break;
        else
        {
            cout << setiosflags(ios::fixed) << setprecision(2);
            output = EvaluateExpression(str);
            cout << output << endl;
        }
    }

 
while (true)
    {
        scanf("%s",str);
        ch = str[0];
        if (ch == '=')
            break;
        else
        {
            printf("%c%c",setiosflags(ios::fixed),setprecision(2));
            output = EvaluateExpression(str);
            printf("%c",output);
        }
    }

你的函数类型,没有给我,我就直接默认都是字符型了