用C语言写的计算器源代码.docx
《用C语言写的计算器源代码.docx》由会员分享,可在线阅读,更多相关《用C语言写的计算器源代码.docx(6页珍藏版)》请在三一办公上搜索。
1、用C语言写的计算器源代码用C语言写的计算器源代码.txt什么叫神话?请听男人向你表达爱意;什么叫传说?请听男人对你的承诺;什么叫梦境?请看你自己听到前两者时的反应。用C语言写的计算器源代码 #include #include #include #include #include typedef float DataType; typedef struct DataType *data; int max; int top; Stack; void SetStack(Stack *S,int n) S-data=(DataType*)malloc(n*sizeof(DataType); if(S-
2、data=NULL) printf(overflow); exit(1); S-max=n; S-top=-1; void FreeStack(Stack *S) free(S-data); int StackEmpty(Stack *S) if(S-top=-1) return(1); return(0); DataType Peek(Stack *S) if(S-top=S-max-1) printf(Stack is empty!n); exit(1); return(S-dataS-top); void Push(Stack *S,DataType item) if(S-top=S-m
3、ax-1) printf(Stack is full!n); exit(1); S-top+; S-dataS-top=item; DataType Pop(Stack *S) if(S-top=-1) printf(Pop an empty stack!n); exit(1); S-top-; return(S-dataS-top+1); typedef struct char op; int inputprecedence; int stackprecedence; DataType1; typedef struct DataType1 *data; int max; int top; S
4、tack1; void SetStack1(Stack1 *S,int n) S-data=(DataType1*)malloc(n*sizeof(DataType1); if(S-data=NULL) printf(overflow); exit(1); S-max=n; S-top=-1; void FreeStack1(Stack1 *S) free(S-data); int StackEmpty1(Stack1 *S) if(S-top=-1) return(1); return(0); DataType1 Peek1(Stack1 *S) if(S-top=S-max-1) prin
5、tf(Stack1 is empty!n); exit(1); return(S-dataS-top); void Push1(Stack1 *S,DataType1 item) if(S-top=S-max-1) printf(Stack is full!n); exit(1); S-top+; S-dataS-top=item; DataType1 Pop1(Stack1 *S) if(S-top=-1) printf(Pop an empty stack!n); exit(1); S-top-; return(S-dataS-top+1); DataType1 MathOptr(char
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 语言 计算器 源代码
![提示](https://www.31ppt.com/images/bang_tan.gif)
链接地址:https://www.31ppt.com/p-3658280.html