堆栈四则运算
代码说明:
/* 在BC31下编译 或VC6.0*/ /* compile under Borland C++ 3.1 or Visual C++ 6.0*/ /*#include "stdafx.h"*/ #include "stdio.h" #include "string.h" #include "stdlib.h" #include "conio.h" #define TRUE 1 #define FALSE 0 #define STACK_INIT_SIZE 100/*存储空间初始分配量*/ #define STACKINCREMENT 20/*存储空间分配增量*/ typedef struct { int *pBase;/*在构造之前和销毁之后,base的值为NULL*/ int *pTop;/*栈顶指针*/ int StackSize;/*当前已分配的存储空间,以元素为单位*/ }Stack; typedef int BOOLEAN; char Operator[8]="+-*/()#";/*合法的操作符存储在字符串中*/ char Optr;/*操作符*/ int Opnd=-1;/*操作符*/ int Result;/*操作结果*/ /
下载说明:请别用迅雷下载,失败请重下,重下不扣分!


