华为机试题 四则运算

简介

用传统的算法, 可能要用到递归栈, 什么鬼. 太难记了
还是python香.

code

a=input()
a = a.replace('{', '(')
a = a.replace('}', ')')
a = a.replace('[', '(')
a = a.replace(']', ')')
a = a.replace('/', '//')
print(eval(a))
Hope is a good thing,maybe the best of things,and no good thing ever dies.----------- Andy Dufresne
原文地址:https://www.cnblogs.com/eat-too-much/p/14943522.html