1175: [NOIP2013 普及组] 表达式求值

文件提交:无需freopen 内存限制:125 MB 时间限制:1.000 S
评测方式:普通裁判 命题人:
提交:1 解决:1

题目描述

给定一个只包含加法和乘法的算术表达式,请你编程计算表达式的值。

输入

一行,为需要你计算的表达式,表达式中只包含数字、加法运算符 “lns="http://www.w3.org/1998/Math/MathML">+” 和乘法运算符 “lns="http://www.w3.org/1998/Math/MathML">×”,且没有括号,所有参与运算的数字均为 lns="http://www.w3.org/1998/Math/MathML">0 到 lns="http://www.w3.org/1998/Math/MathML">2311 之间的整数。

输入数据保证这一行只有 lns="http://www.w3.org/1998/Math/MathML">09lns="http://www.w3.org/1998/Math/MathML">+lns="http://www.w3.org/1998/Math/MathML">× 这 lns="http://www.w3.org/1998/Math/MathML">12种字符。

输出

一个整数,表示这个表达式的值。

注意:当答案长度多于 lns="http://www.w3.org/1998/Math/MathML">4 位时,请只输出最后 lns="http://www.w3.org/1998/Math/MathML">4 位,前导 lns="http://www.w3.org/1998/Math/MathML">0 不输出。

样例输入

1+1*3+4

样例输出

8

提示

对于 lns="http://www.w3.org/1998/Math/MathML">30% 的数据,lns="http://www.w3.org/1998/Math/MathML">0 表达式中加法运算符和乘法运算符的总数 lns="http://www.w3.org/1998/Math/MathML">100

对于 lns="http://www.w3.org/1998/Math/MathML">80% 的数据,lns="http://www.w3.org/1998/Math/MathML">0 表达式中加法运算符和乘法运算符的总数 lns="http://www.w3.org/1998/Math/MathML">1000

对于 lns="http://www.w3.org/1998/Math/MathML">100% 的数据,lns="http://www.w3.org/1998/Math/MathML">0 表达式中加法运算符和乘法运算符的总数 lns="http://www.w3.org/1998/Math/MathML">100000