#K80177. Arithmetic Expression Evaluation
Arithmetic Expression Evaluation
Arithmetic Expression Evaluation
Given a string representing a valid arithmetic expression that may include non-negative integers and the operators +
, -
, *
, and /
, evaluate the expression and print its result. The operator precedence follows the rules: multiplication and division are evaluated before addition and subtraction, and all operators are left-associative. Note that division is performed as integer division (i.e., the result is truncated towards zero). It is guaranteed that the input expression is syntactically correct.
inputFormat
The input consists of a single line containing an arithmetic expression. The expression may include spaces.
outputFormat
Output a single integer — the result of evaluating the expression.
## sample1+1
2