postfix:CMP344 Andrew Klump ch4 Postifix 计算器

时间:2024-07-15 08:27:45
【文件属性】:

文件名称:postfix:CMP344 Andrew Klump ch4 Postifix 计算器

文件大小:2KB

文件格式:ZIP

更新时间:2024-07-15 08:27:45

JavaScript

后缀 CMP344 Andrew Klump ch4 Postifix 计算器 这将中缀方程转换为后缀方程使用 convertToPost(equation); 然后它使用后缀形式进行数学运算 这使用 doMath(postfix equation); 下面的例子是组合功能 但是,只需使用 convertToPost 打印出后缀方程 但是在 Console.log 中同时使用 convertToPost 和 doMath 不会只打印后缀方程一个空格然后是答案。 只使用个位数!! 不以 Capouch 解释的相同方式使用这两个堆栈 convertToPost("1+2-5"); //打印出答案 console.log(doMath(convertToPost(1+2-5))); convertToPost("1-3+9 10/4+8"); console.log(doMath(co


【文件预览】:
postfix-master
----postfix.js(4KB)
----README.md(746B)

网友评论