⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 d_postfixeval.h

📁 后辍表达式的计算
💻 H
字号:
#include<iostream>
using namespace std;
#include<stack>
#include<string>
#include "d_infixToPostfix.h"
class postfixEval{
public:
	postfixEval();//默认的构造函数
	string getPostfix() const;//获得后辍表达式
	void setPostfix(const string& postfix);//设置后辍表达式
	double evaluate();//最后的值
private:
	string postfixExpression;//后辍表达式
	stack<double> operandStack;//存放操作数的栈
	void getOperands(double& left,double& right);//获得操作数
	double compute(double left,double right,char command) const;//计算
	bool isCommand(char command) const;//判断是不是操作数
};


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -