#include <iostream>
#include <stack>
#include <string>
#include <cstring>
using namespace std;
class Exp {
stack<char> ops; // 运算符栈
stack<double> ds; // 数据栈
double v, lh, rh; // 计算结果和临时变量
char op; // 读取运算符
public:
double calinput() { //读取并计算表达式,直到结束为止
do {
readdata(); //读取数据
skipspace(); //跳过空白
} wh
通过入栈出栈实现数学表达式的计算
最新推荐文章于 2024-04-20 20:18:23 发布