64,645
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <string>
#include "cexpr.h"
using namespace std;
float calc(string x)
{
CExpression p(x);
return p.Calculate();
}
int main()
{
string x="(2*3+5/7)*6"; //表达式,包括括号和运算符
cout << calc(x) << endl; //调用计算函数
}