应该是最完善的算法,就是加法乘法可能被计算次数多了一倍,懒得改了。 def dfs(): if len(cards) == 1: return abs(24 - cards[0]) < 0.0000001 for i in cards.copy(): cards.remove(i) for j in cards.copy(): cards.remove(j) cards.append(i + j) if dfs(): re...