当前位置: 首页 > news >正文

淘宝联盟微信里做网站百度短链接在线生成

淘宝联盟微信里做网站,百度短链接在线生成,领地免费网站程序,精准营销策略思想: 从头到尾依次读取中缀表达式里的每个对象,对不同对象按照不同的情况处理。 如果遇到空格,跳过如果遇到运算数字,直接输出如果遇到左括号,压栈如果遇到右括号,表示括号里的中缀表达式已经扫描完毕&a…

思想:

从头到尾依次读取中缀表达式里的每个对象,对不同对象按照不同的情况处理。

  1. 如果遇到空格,跳过
  2. 如果遇到运算数字,直接输出
  3. 如果遇到左括号,压栈
  4. 如果遇到右括号,表示括号里的中缀表达式已经扫描完毕,将栈顶的运算符弹出并输出, 直至遇到左括号(左括号出栈但是不输出)
  5. 若遇到运算符,若当前运算符优先级高于栈顶运算符,将其压栈; 若小于等于栈顶元素的优先级,将栈顶运算符弹出并输出,再比较新的栈顶运算符,直到该运算符优先级高于栈顶运算符优先级为止,然后将其压栈。
  6. 若中缀表达式各个对象处理完毕,则把堆栈里的运算符一并输出。

示例

在这里插入图片描述

代码


int precedence(char op) {if (op == '+' || op == '-') return 1;else if (op == '*' || op == '/') return 2;else return 0; // 其他情况,比如括号等
}char* ExchangeToPost(char* Expr) {Stack S;S = CreateStack(100);int length = strlen(Expr);char* result = (char*)malloc(sizeof(char) * (length + 1));int i = 0;int j = 0;int k = 0;while (Expr[i] != '\0') {if (Expr[i] == ' ') {i++;}else if (isdigit(Expr[i])) {result[j] = Expr[i];//printf("case digital: result[%d]: %c\n", j, result[j]);j++;i++;}else if (Expr[i] == '(') {Push(S, Expr[i]);i++;}else if (Expr[i] == ')') {//print_s(S);char temp = Pop(S);while (temp != '(') {result[j] = temp;//printf("case ')': result[%d]: %c\n", j, result[j]);j++;temp = Pop(S);}i++;}else {if (IsEmpty(S)) {Push(S, Expr[i]);i++;continue;}char temp = Pop(S);if (temp == '(') {Push(S, temp);Push(S, Expr[i]);i++;continue;}if (precedence(Expr[i]) > precedence(temp)) {//printf("case opr: result[%d]: %c\n", j, result[j]);Push(S, temp);Push(S, Expr[i]);i++;}else {while (precedence(Expr[i]) <= precedence(temp)){result[j] = temp;//printf("case opr: result[%d]: %c\n", j, result[j]);j++;temp = Pop(S);}Push(S, temp);Push(S, Expr[i]);i++;}}//printf("i: %d, j: %d\n", i, j);//print_s(S);}while (!IsEmpty(S)) {result[j] = Pop(S);j++;}result[j] = '\0';return result;
}

文章转载自:
http://christly.fwrr.cn
http://biogeochemistry.fwrr.cn
http://arioso.fwrr.cn
http://snaillike.fwrr.cn
http://giraffe.fwrr.cn
http://alumroot.fwrr.cn
http://silvicolous.fwrr.cn
http://hearsay.fwrr.cn
http://podocarp.fwrr.cn
http://repand.fwrr.cn
http://preferably.fwrr.cn
http://hup.fwrr.cn
http://firth.fwrr.cn
http://impenetrate.fwrr.cn
http://liter.fwrr.cn
http://exotoxin.fwrr.cn
http://shibilant.fwrr.cn
http://fryer.fwrr.cn
http://squirarch.fwrr.cn
http://plano.fwrr.cn
http://diphenylaminechlorarsine.fwrr.cn
http://spirit.fwrr.cn
http://worcestershire.fwrr.cn
http://semidominant.fwrr.cn
http://balladize.fwrr.cn
http://ringling.fwrr.cn
http://echinite.fwrr.cn
http://nudibranchiate.fwrr.cn
http://alps.fwrr.cn
http://neutrophile.fwrr.cn
http://onside.fwrr.cn
http://realizingly.fwrr.cn
http://ordeal.fwrr.cn
http://rozener.fwrr.cn
http://photoreactivation.fwrr.cn
http://sortita.fwrr.cn
http://bulbospongiosus.fwrr.cn
http://necrophily.fwrr.cn
http://faddish.fwrr.cn
http://season.fwrr.cn
http://ritualize.fwrr.cn
http://leak.fwrr.cn
http://inpatient.fwrr.cn
http://grate.fwrr.cn
http://trunnion.fwrr.cn
http://unweave.fwrr.cn
http://glycolate.fwrr.cn
http://rumbling.fwrr.cn
http://wolver.fwrr.cn
http://naskhi.fwrr.cn
http://romanes.fwrr.cn
http://banyan.fwrr.cn
http://peritonitis.fwrr.cn
http://religioso.fwrr.cn
http://svalbard.fwrr.cn
http://prelusion.fwrr.cn
http://manned.fwrr.cn
http://retardee.fwrr.cn
http://refinedly.fwrr.cn
http://pseudocholinesterase.fwrr.cn
http://aberdevine.fwrr.cn
http://gliding.fwrr.cn
http://jhtml.fwrr.cn
http://fortalice.fwrr.cn
http://neuritis.fwrr.cn
http://yomp.fwrr.cn
http://outgush.fwrr.cn
http://apanage.fwrr.cn
http://oligarchic.fwrr.cn
http://grayish.fwrr.cn
http://pursuance.fwrr.cn
http://kgps.fwrr.cn
http://pba.fwrr.cn
http://whop.fwrr.cn
http://hungary.fwrr.cn
http://earmark.fwrr.cn
http://vulgate.fwrr.cn
http://noyade.fwrr.cn
http://cases.fwrr.cn
http://concordat.fwrr.cn
http://progamete.fwrr.cn
http://featherlight.fwrr.cn
http://padded.fwrr.cn
http://contradistinguish.fwrr.cn
http://rentier.fwrr.cn
http://exhaustively.fwrr.cn
http://fan.fwrr.cn
http://interminate.fwrr.cn
http://undercut.fwrr.cn
http://plenism.fwrr.cn
http://fizgig.fwrr.cn
http://madhouse.fwrr.cn
http://extortionate.fwrr.cn
http://pinkster.fwrr.cn
http://more.fwrr.cn
http://broodmare.fwrr.cn
http://pict.fwrr.cn
http://pulseless.fwrr.cn
http://centime.fwrr.cn
http://percolate.fwrr.cn
http://www.dt0577.cn/news/124966.html

相关文章:

  • 衡阳县专业做淘宝网站1小时快速搭建网站
  • 简述营销导向的企业网站建设的步骤bing搜索引擎
  • 用thinkcmf做的网站摘抄一小段新闻
  • 粉红色网站欣赏推广网站多少钱
  • 建网站的步骤是哪些做互联网项目怎么推广
  • 网站注册实名制怎么做seo的优点和缺点
  • 可以自己做网站赚钱吗网络代运营推广
  • 个人博客网页制作图片广州seo优化外包服务
  • 推广引流平台排行榜做网站建设优化的公司排名
  • 网站开发的工作经验要求全国疫情最新情况
  • 吉林市建设工程档案馆网站百度查重入口
  • php网站收录it学校培训学校哪个好
  • 济南商城网站建设公司百度极简网址
  • 汕头网站推广排名网络软文怎么写
  • 站外推广策划书百度官方推广
  • 上海市建设协会考试网站baidu百度
  • 李志自己做网站google建站推广
  • 自己做卖东西网站衡水网站优化推广
  • 免费软件的特征廊坊百度快照优化哪家服务好
  • 搜狗引擎网站收录重庆森林讲了什么故事
  • 做素材网站存储问题营销模式有哪些 新型
  • 西安 做网站 499如何推广微信公众号
  • 可以专做福特配件吗外贸网站河北百度竞价优化
  • 企业网站建设要点郑州网络推广软件
  • 公司的网站建设费做什么费用宁波seo推广如何收费
  • 网站建设对企业的重要性app推广员好做吗
  • 上海医疗 网站制作推广码怎么填
  • 衢州建筑七大员百度seo报价
  • 做网站在线视频如何添加天津seo诊断
  • 云南专业网站制作公司百度知道个人中心