C++ 输入值处理作为数学函数

C++ input value process as math function

我是 C++ 的新手,我需要你的帮助。我想将输入值用作数学函数然后打印结果。

我需要的是:

When user input: 2 +1 and hit Enter then output (cout>>) should be your result is: 3 (the sum of 2 + 1)

数学符号可以是+或*或/或-。

你能帮我举个例子吗?

提前致谢!

搜索 "Reverse Polish notation" 并在 C++ 中实现