17 人解决,28 人已尝试。
24 份提交通过,共有 109 份提交。
5.8 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
After learnt then Principles of Compiler,partychen thought that he can solve a simple expression problem.So he give you strings of less than 100 characters which strictly adhere to the following grammar (given in EBNF):
Expression := Term { (‘+’ | ‘-‘) Term }
Term := Factor { (‘*’|’/’) Factor }
Factor := Number | ‘(‘ Expression ‘)’
Number := Digit | Digit Number
Digit := ‘0’ | ‘1’ | … | ‘9’
Can you solve them too?
The first line of gives a string as described above.
output the expression’s result in a single line
((1+1-1)*123)+(2*3-10)/2+25
146 Hint: If you meet “/”,you only save the Integral part.For example,5/2,the result is 2.
17 人解决,28 人已尝试。
24 份提交通过,共有 109 份提交。
5.8 EMB 奖励。