#K73927. Simple Arithmetic Expression Evaluator
Simple Arithmetic Expression Evaluator
Simple Arithmetic Expression Evaluator
Given a mathematical expression that only involves integers, addition, and subtraction, your task is to compute its value. The expression may include extra spaces between numbers and operators.
The expression is of the form:
\( expression = a_1 \pm a_2 \pm \cdots \pm a_n \)
You need to read the expression from the standard input (STDIN) and output the computed integer result to standard output (STDOUT).
inputFormat
The input consists of a single line containing the arithmetic expression. The expression can include spaces, digits (0-9), a plus sign (+), and a minus sign (-).
outputFormat
Output a single integer which is the result of evaluating the given expression.
## sample3 + 5 - 2
6