Fun With Expresions
Submissions: 226   Accuracy:

24.77%

  Difficulty: Easy   Marks: 2

Evaluate the expression given from left to right in the order the operators come. The expression consists of 4 basic operators +, /, *, -. But it is not certain that which will come first. Operators can come in any order.

Input:
First line consists of T test cases. The next T lines consists of the expressions in each line. 

Output:

The answer should be the floor value of the expression's result.

Constraints:
1<=T<=100
1<=operand value<=100
1<=operators<=4

Example:
Input:

3
10*20+10
16*5-5/15
4/5-8

Output:
210
5
-8

** For More Input/Output Examples Use 'Expected Output' option **

Author: Ayush Saluja


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.