#P1981. [NOIP 2013 普及组] 表达式求值

[NOIP 2013 普及组] 表达式求值

Description

Given an arithmetic expression that contains only addition and multiplication, compute the value of the expression.

Input Format

One line: the expression to evaluate. The expression contains only digits, the addition operator +, and the multiplication operator *, with no parentheses. Every number that appears is an integer from 00 to 23112^{31}-1.

The input guarantees that this line contains only these 1212 characters: 0123456789+*.

Output Format

Output a single integer: the value of the expression.

Note: If the answer has more than 44 digits, output only the last 44 digits, and do not output leading 00s.

1+1*3+4

8
1+1234567890*1
7891
1+1000000003*1
4

Hint

For 30%30\% of the testdata, the total number of addition and multiplication operators in the expression is between 00 and 100100 inclusive.

For 80%80\% of the testdata, the total number of addition and multiplication operators in the expression is between 00 and 10001000 inclusive.

For 100%100\% of the testdata, the total number of addition and multiplication operators in the expression is between 00 and 100000100000 inclusive.

Translated by ChatGPT 5