Go back to Challenges list
Multi Operation Calculator
In this challenge you need to build a calculator that can perform multiple operation like add, subtract, multiply and divide at the same time.The operation symbols are +, -, * and /. There will be no parenthesis on the mathematical expressions but remember that * and / operators have precedence over + and -.
Input FormatEach test case contains the N numbers and N-1 symbols interspersed for the multiple mathematical operations. All of them are separated by a blank space and all numbers are integers.
Output FormatFor each test case output the operation result.
15 + 2 - 4 + 2
-4 / 2 + 2