📅  最后修改于: 2022-03-11 15:01:42.191000             🧑  作者: Mango
def p(e):
for o in"+-*/":
for i,c in enumerate(e):
if(c==o)*(0==sum([(d=="(")-(d==")")for d in e[:i]])):return"("+p(e[:i])+o+p(e[i+1:])+")"
return e