和简单计算器一模一样直接搬过来用了 #include<iostream> #include<cstdio> #include<stack> #include<map> #include<string> using namespace std; map<char, int> priority = { {'+',1},{'-',1}, {'*',2},{'/',2} }; float getnum(int &index, string str) { //将字符串化为整数 float res = 0; wh...