#C10525. Taco Expression Evaluation
Taco Expression Evaluation
Taco Expression Evaluation
You are given a single line containing an arithmetic expression. The expression consists of positive integers, the binary operators +
, -
, and *
, and parentheses. Your task is to evaluate the expression following the usual operator precedence rules: multiplication has higher precedence than addition and subtraction, and parentheses can override these rules.
The precedence rules in \( \LaTeX \) are expressed as: \( \times \) has higher precedence than \( + \) and \( - \).
Note: All tokens in the expression are separated by spaces.
inputFormat
The input is given via standard input as a single line containing the arithmetic expression.
Example: 3 * ( 4 + 5 ) - 6
outputFormat
The output is a single integer, which is the result of evaluating the given expression. The output should be printed to standard output.
## sample3 * ( 4 + 5 ) - 6
21