Problem list
Log in
#r03360 · Online Judge > GoldOJ

Evaluate Postfix Expression

Silver III 2.0 s 1024 MB

Evaluate a postfix expression containing single-digit operands and the operators +, -, *, /. Division truncates toward zero (so $-3/2 = -1$). No division by zero occurs.

Input

One postfix expression of length $1$ to $100000$.

Output

Print the value of the expression.

Example 1

Input
12+34+*
Output
21
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code