先把中缀表达式转换成表达式树保存下来,再用后缀表达式计算,过程比较繁琐所幸最后还是封装成了一个类写的很挫的View Code #include<cstdio>#include<cstring>#include<algorithm>#include<cstdlib>#include<iostream>using namespace std;int flag;bool pre;class calc{ enum Type { DATA,ADD,SUB,MULTI,DIV,OPAREN,CPAREN,EOL}; struct node { T Read More