You are asking to write a calculator which can do the following operations:+, -, *, /, ^ and ().
All input numbers are integers and no floating numbers appeared during the calculation.
You are asking to write a calculator which can do the following operations:+, -, *, /, ^ and ().
All input numbers are integers and no floating numbers appeared during the calculation.
The first line is the number of test cases, T (1 <= T <= 10)
For each test case, there is only one line with the expression. The input is always legal.
The length of expression will not exceed 50. And all median results don’t exceed 1000.
All input numbers are positive. All input expressions follow the rules in Math.
1
5+6*3-2/2+1
23
Bonus problem