#C14154. Expression Evaluator
Expression Evaluator
Expression Evaluator
Given a mathematical expression as a string, evaluate it and output the result as an integer.
The expression contains non-negative integers, the binary operators \(+\), \(-\), \(*\), and \(/\) (denoting integer division), and may include parentheses \((\) and \()\). The operations follow the standard operator precedence and associativity rules. It is guaranteed that the given expression is valid.
For example, the expression 100 * ( 2 + 12 ) / 14
is evaluated as follows:
\[ 100 * ( 2 + 12 ) / 14 = 100 * 14 / 14 = 100 \]
Your task is to compute and output the result of the given expression.
inputFormat
The input consists of a single line containing a valid mathematical expression. The expression may include spaces.
Note: The division operator \(/\) denotes integer division (i.e. truncating division).
outputFormat
Output the evaluated result as an integer on a single line.
## sample3+2
5
</p>