常规表达式转换为后缀表达式
来源:互联网 发布:sql server2012教程 编辑:程序博客网 时间:2024/05/23 12:35
/*常规表达式转换为后缀表达式*/#include<stdio.h>char op[20],postexp[50];int r=-1;char pop(){return op[r--];}void push(char c){r++;op[r]=c;}int main(){int i,front=0,flag=0,flag2=0;char c;r++;op[r]='=';while((c=getchar())!='\n'&&flag==0){while(c>='0'&&c<='9'){postexp[front++]=c;c=getchar();flag2=1;}if(flag2==1){flag2=0;postexp[front++]='#';}if(c=='\n')flag=1;else if(c==')') { while((c=pop())!='(') { postexp[front++]=c; } } else if(c=='('||c=='-'||c=='+'||c=='*'||c=='/') { push(c); }}while((c=pop())!='=')postexp[front++]=c;for(i=0;i<front;i++)printf("%c",postexp[i]);printf("\n");return 0;}
0 0
- 常规表达式转换为后缀表达式
- 常规表达式转换为后缀表达式
- 常规表达式转化为后缀表达式再求值
- 中缀表达式转换为后缀表达式,计算后缀表达式
- 中缀表达式转换为后缀表达式&后缀表达式的计算
- 中缀表达式转换为后缀表达式(C)
- 中缀表达式转换为后缀表达式算法
- 中缀表达式转换为后缀表达式
- 中缀表达式转换为后缀表达式
- 中缀表达式转换为后缀表达式
- 中缀表达式转换为后缀表达式
- 中缀表达式转换为后缀表达式
- 中缀表达式转换为后缀表达式
- 中缀表达式转换为后缀表达式
- 中缀表达式转换为后缀表达式
- 中缀表达式转换为后缀表达式
- 中缀表达式转换为后缀表达式
- 中缀表达式转换为后缀表达式
- HashMap的实现原理
- LoadRunner中如何验证下载的文件大小、统计下载时间、度量下载速度?
- Objective-C消息机制
- Android 手机震动功能实现
- BI Publisher论坛
- 常规表达式转换为后缀表达式
- Android Studio 快捷键 for Mac OS X
- volatile的作用
- 安装最新版cordova遇到的问题
- org.apache.catalina.tribes.ChannelException: java.net.SocketException
- 中文版iTween帮助文档、参数解析
- 我觉得markdown编辑器的问题
- 常规表达式转化为后缀表达式再求值
- sock获取当前服务器地址