题解 | #四则运算#
四则运算
https://www.nowcoder.com/practice/9999764a61484d819056f807d2a91f1e
s = input() # 3+2*{1+2*[-4/(8-6)+7]} s = s.replace("{", "(") s = s.replace("}", ")") s = s.replace("[", "(") s = s.replace("]", ")") print(int(eval(s)))
四则运算
https://www.nowcoder.com/practice/9999764a61484d819056f807d2a91f1e
s = input() # 3+2*{1+2*[-4/(8-6)+7]} s = s.replace("{", "(") s = s.replace("}", ")") s = s.replace("[", "(") s = s.replace("]", ")") print(int(eval(s)))
相关推荐