捌玖网络工作室's Archiver
捌玖网络工作室
»
网页编程
» C语言表达式计算器
zw2004
发表于 2008-1-21 17:17
C语言表达式计算器
为了方便了解流程,在程序中把计算过程也输出了.而且栈操作的实现部分也是自己实现的.
.j wJe)y5@Y
程序用两个栈,optr寄存运算符,opnd寄存操作数和运算结果.输入的表达式以等号结束,例如:2*(1+2)=
x+C ]7a["@ qZ0[B#B
/**************表达式计算器************/
TABs L7A-d"~W
#include <stdio.h>
nS8E-I't-^4s'^
#include <stdlib.h>
o3ZYjw\_k?)q;Z u.S
#include <string.h>
B!Fy5s:H(M
#include <conio.h>