#K761. Evaluate Mathematical Expression

    ID: 34567 Type: Default 1000ms 256MiB

Evaluate Mathematical Expression

Evaluate Mathematical Expression

Given a string representing a mathematical expression with positive integers (and optionally decimals) and the operators +, -, *, and /, evaluate the expression and output the result as a floating-point number rounded to exactly two decimal places. The expression follows the standard operator precedence rules, i.e. multiplication and division have higher precedence than addition and subtraction. For example, the expression 14 / 3 + 2 should be evaluated as \(\frac{14}{3} + 2\) and produce an output of 6.67.

Note: The input is provided via standard input (stdin) and the result must be printed to standard output (stdout).

inputFormat

The input consists of a single line containing a valid arithmetic expression. The expression may include positive integers, decimal numbers, and the operators +, -, *, and / separated by spaces.

For example:

3 + 5

outputFormat

Output a single line containing the evaluated result of the expression, rounded and formatted to exactly two decimal places.

For example:

8.00
## sample
3 + 5
8.00