Programming Principles 1. Week 6. October 7 - 13. PART 2
Specifies the expression that contains only numbers and operations + and *. Calculate the value of the expression, assuming that the operations * and + have the same priority. In this case 2 + 2 * 2 equals 8.
Given non-empty string S with no more than 9 characters. S line contains only numbers, and operators + and *. S always starts with a number and sets the correct recording of an arithmetic expression. Left and right of each operation is a figure to the left and to the right of each digit is placed or the beginning \ end of line, or a mathematical operation.
Print the result of expression.