如题,代码如下,欢迎探讨!!![code=C/C++][/code]#include typedef int ElemType; #define MAXNUM 16struct stack{ElemType data[MAXNUM];int top;};void StackInit(struct stack *stack){int i = 0;for(;i< MAXNUM;i++){stack->data[i] = 0;}stack->top = 0; }void StackPush(struct stack *stack,ElemType c){if(MAXNUM == stack->top) {printf("The stack is full ");return;}stack->data[stack->top++] = c;}ElemType StackPop(struct stack *stack){if(0 == stack->top){printf("The stack is empty "); }int ChangeToPostfix(char *str){int i = 0,flag = 0; int c,ch;struct stack ch_stack;struct stack op_stack;StackInit(&ch_stack);StackInit(&op_stack);while( != (c = *(str + i))) {if((* == c) || (/ == c) || (( == c)){flag = 0;StackPush(&op_stack,c);}else if() == c){flag = 0;while(( != (c = StackPop(&op_stack))){StackPush(&ch_stack,c);}if(0 == op_stack.top){printf("the ( hasnt found when the ) come in! ");return -1;}}else if((+ == c)|| (- == c)){flag = 0;if(0 != op_stack.top) { while(( != (ch = StackPop(&op_stack))){StackPush(&ch_stack,ch);if(0 == op_stack.top){break;}}}StackPush(&op_stack,c);}else if((c >= 0) && (c