#K86437. Evaluate Mathematical Expressions
Evaluate Mathematical Expressions
Evaluate Mathematical Expressions
You are given a mathematical expression consisting of positive integers and the operators +, -, *, and /. All expressions should be evaluated following the standard operator precedence. Note that the operator / represents integer division, i.e., for any two integers \(a\) and \(b\), \(a/b\) is computed as \(\lfloor a/b \rfloor\).
Your task is to compute the value of the expression for each test case.
Example:
The expression \(8 / 2 + 3\) is evaluated as \(\lfloor8/2\rfloor + 3 = 4 + 3 = 7\).
inputFormat
The first line of input contains an integer \(T\) denoting the number of test cases. Each of the following \(T\) lines contains a valid mathematical expression. Each expression may include digits, spaces, and the operators \(+, -, *, /\).
outputFormat
For each test case, output a single integer representing the result of evaluating the expression. The output for each test case should be printed on a new line.
## sample1
3 + 5
8
</p>