Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我们用大括号和不带大括号的后缀表达式解决中缀表达式,它们会产生相同的结果吗?
例子:
这两个例子会产生相同的结果吗?如果不是,那为什么不呢?
通常,由于操作的优先级,它不会产生相同的结果。例如,如果您定义*的优先级高于+and -,则*必须在+or之前进行计算-,这会改变表达式的计算方式,也会改变后缀表示。
*
+
-