#include<iostream>
#include<string>
#include<stack>
#include<sstream>
using namespace std;
int getP(char ch)
{
//获取优先级
if (ch == '(') return 1;
else if (ch == '+' || ch == '-') return 2;
else if (ch == '*' || ch == '/') return 3;
else return 4;
}
void calculate(stack<double> &opnd, char op)
//参数1:当前操作数栈【为什么使用引用符号“&”:引用传递,加快速度】
//参数2:运算符
{
double num1, num2, num3;
num2 = opnd.top();
opnd.pop();
num1 = opnd.top();
opnd.pop();
if (op == '+') {
num3 = num1 + num2;
}
else if (op == '-') {
num3 = num1 - num2;
}
else if (op == '*') {
num3 = num1 * num2;
}
else if