摘要: 将中缀表达式转换为后缀表达式的算法思想如下: 从左往右开始扫描中缀表达式 遇到数字加入到后缀表达式 遇到运算符时: 1、若为‘(’,入栈 2、若为’)‘,把栈中的运算符依次加入后缀表达式,直到出现'(',’(‘出栈,退出该次循环 3、若除’(‘ 和 ‘)’,要入栈的运算符优先级大于等于栈顶的运算符的 阅读全文
posted @ 2018-07-12 21:17 ybf&yyj 阅读(3850) 评论(1) 推荐(0)
摘要: #include <iostream> #include <stdlib.h> #include <string.h> #include <algorithm> #include <vector> #include <list> #include <deque> using namespace st 阅读全文
posted @ 2018-07-12 13:23 ybf&yyj 阅读(1132) 评论(0) 推荐(0)