数据结构课程设计(算术表达式求值).docxVIP

  • 142
  • 0
  • 约4.14千字
  • 约 14页
  • 2021-08-29 发布于辽宁
  • 举报

数据结构课程设计(算术表达式求值).docx

数据结构课程设计(算 术 表 达 式 求 值 ) - 计 算 器 咼级语言程序设计 《算术表达式求值》 课程设计报告 第一章系统目标 算术表达式求值 系统可以实现实现对算术四则混合运算表达式求值,并打印求值过程中运算符 栈、操作数栈的变化过程。 第二章系统分析 开始运行时界面如下: 你可以输入一个表达式,按 E对其进行求值 第三章系统设计 第四章系统实现 #i nclude stdio.h #in elude vconi o.h #i nclude stdlib.h #i nclude stri ng.h #defi ne N 100 double numStack[N]={0};〃 操作数栈 int nu mTop; char opStack[N];// 运算符栈 int opTop; void print_nu m(double str1[],i nt n) { int i; printf(\n 操作数栈:\n); for(i=0;i n;i++) prin tf(%g ,str1[i]); } void prin t_op(char str2[],i nt m) { int j; printf(\n 运算符栈:\n); for(j=0;jm;j++) prin tf(%c ,str2[j]); } in t op(char ch)// 判断运算符优先级 { if(ch==+|

文档评论(0)

1亿VIP精品文档

相关文档