1015: Reverse Polish notation
Description
Reverse Polish notation is a notation where every operator follows all of its operands. For example, an ex
Write a program which reads an ex
Input
An ex
You can assume that +, - and * , / are given as the operator and an operand is a positive integer less than 106 ( the result of / is guaranteed integer)
2 ≤ the number of operands in the ex
1 ≤ the number of operators in the ex
-1 × 109 ≤ values in the stack ≤ 109
Output
Sample Input Copy
1 2 + 3 4 - *
Sample Output Copy
-3