项目作者: Hoodster

项目描述 :
Reverse Polish Notation impementation for C++
高级语言: C++
项目地址: git://github.com/Hoodster/ONP.git
创建时间: 2018-04-10T15:17:23Z
项目社区:https://github.com/Hoodster/ONP

开源协议:MIT License

下载


ONP

Reverse Polish Notation impementation for C++.

Do you want to know what RPN is? Click here and read more about it.

Problem

Reverse Polish notation is a easier way to write a mathematical equation by not parenthesized expressions. It’s also common calculator type in computing because no bracets are needed.

Solution

Program gets all equation input in reverse Polish notation and prints computed result.

How to use it

1. Adding expresson

  1. Write number (double type is supported) or math opeartion symbol (+,-,*,/)
  2. Click ENTER

    2. Computing RPN equation

  3. Write equation symbol [=]
  4. Click ENTER

    Sample

For ((2+7)/3+(14-3)*4)/2

((2+7)/3+(14-3)*4)/2 => 2 7 + 3 / 14 3 - 4 * + 2 /

Result:




Result is 23.5.

Implementation:




Each number or char in separate row. Result is 23.5.