数字为个位数,不考虑语法错误
#include<stdio.h>
#include<stdlib.h>
#define add 43
#define subs 45
#define mult 42
#define div 47
#define MAXSIZE 100
typedef struct stack
{
int stkdata[MAXSIZE];
int top;
};
int init_stack(struct stack *s)
{
s->top=-1;
return 1;
}
int push(struc...
这是一个简单的中缀表达式求值代码,数字均为个位数,运算符+,-,*,/,不考虑语法错误
#include<stdio.h>
#include<stdlib.h>
#define INITSIZE 100
#define INCREMENT 10
typedef struct stack
{
char *base;
char *top;
int stack_size;
};
int init_stack (struct stack *s)
{
s->base=(char *)malloc((INITSIZE)*sizeof(char...