#C13908. Arithmetic Expression Evaluator
Arithmetic Expression Evaluator
Arithmetic Expression Evaluator
In this problem, you are given a string representing an arithmetic expression that consists of non-negative integers and the operators (+, -, \times, \div). Your task is to evaluate the expression following the standard order of operations (i.e. multiplication and division before addition and subtraction). Note that the division used here is integer division, meaning the result of (a \div b) is the integer part of the quotient. The expression may contain whitespace characters that should be ignored.
For example, given the expression "3+2*2", you should first compute the multiplication (2 \times 2 = 4) and then perform the addition, resulting in (3+4=7).
inputFormat
The input consists of a single line containing a valid arithmetic expression. The expression includes non-negative integers and the operators '+', '-', '*', and '/' without any parentheses. Whitespace may appear arbitrarily and should be ignored.
outputFormat
Output a single integer which is the result of evaluating the expression using integer division for '/'.## sample
3+2
5