贴一个代码框架,记住
#include <iostream>
#include <string>
#include <cstring>
#include <map>
#include <cstdio>
int main() {
string s;
while (getline(cin, s)) {
s += '\0';
for (int i = 0; i < s.size(); i++) {
if (isdigit(s[i])) {
} else if (s[i] == ' ' || s[i] == '\0') {
} else { // 处理运算符
// 处理所有更高或同优先级的运算符
while (!ops.empty() && priority[ops.top()] >= priority[s[i]]) {
}
ops.push(s[i]);
}
}
// 处理剩余运算符
while (!ops.empty()) {
}
printf("%.2f\n", nums.top());//输出规则
}
}