Write a program that calculates the value of an arithmetic expression written as a character string. The expression uses only integers, signs of arithmetic operations (+-*/
) and brackets of arbitrary nesting. The result of the division operation – integer.
Input
The input of the program is a character string containing the correct notation of an arithmetic expression, possibly with brackets.
Output
The program should output the value of the expression passed to it as an integer.
Examples
# |
Input |
Output |
1 |
(5+20)*(98-34)/(5*8-23)
|
94
|