
ZOJ Problem Set  3782
Complete the ternary calculation. InputThere are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case: There is a string in the form of "number_{1} operator_{a} number_{2} operator_{b} number_{3}". Each operator will be one of {'+', '' , '*', '/', '%'}, and each number will be an integer in [1, 1000]. OutputFor each test case, output the answer. Sample Input5 1 + 2 * 3 1  8 / 3 1 + 2  3 7 * 8 / 5 5  8 % 3 Sample Output7 1 0 11 3 NoteThe calculation "A % B" means taking the remainder of A divided by B, and "A / B" means taking the quotient. Author: ZHOU, Yuchen Source: The 11th Zhejiang Provincial Collegiate Programming Contest 