Skip to content

Files

Latest commit

8eea152 · Sep 6, 2022

History

History

python

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 5, 2022
Sep 6, 2022
Aug 26, 2022

二分木を使った数式の逆ポーランド記法化と計算のPython 3での実装。

前提条件・依存関係

Python 3が必要です。

ビルドおよび実行

スクリプトを直接実行し、式を入力することにより、入力された式に対して逆ポーランド記法化・計算を行うことができます。

実行例:

$ ./polish.py
input expression: 2 + 5 * 3 - 4
expression: 2+5*3-4
reverse polish notation: 2 5 3 * + 4 -
infix notation: ((2 + (5 * 3)) - 4)
polish notation: - + 2 * 5 3 4
calculated result: 13