C语言表达式计算器
为了方便了解流程,在程序中把计算过程也输出了.而且栈操作的实现部分也是自己实现的.l$o U+e3zfs程序用两个栈,optr寄存运算符,opnd寄存操作数和运算结果.输入的表达式以等号结束,例如:2*(1+2)=
/**************表达式计算器************/.Ct,^$[XjT:B.v
#include <stdio.h>
#include <stdlib.h>)\j9YnBP-[ [g
#include <string.h>
#include <conio.h>
#include <malloc.h>0_L]8`2i]9se
| I1APp'm&w&AW
#define STACK_SIZE 100z dV6lY_"B|[
#define APPEND_SIZE 10
struct SNode{|YA y*]u_
float data; /*存放操作数或者计算结果*/-ODR A2f
char ch; /*存放运算符*/1F f)v(O"eA vj&U,@m
};
struct Stack{
SNode *top;
SNode *base;