(34〇5 〇 6 〇 8 〇 9 〇 1) 〇 2=2008,,[Python]代码fr
(34〇5 〇 6 〇 8 〇 9 〇 1) 〇 2=2008,,[Python]代码fr
[Python]代码
from itertools import productops=["+","-","*"]fmt="(34 %s 5 %s 6 %s 8 %s 9 %s 1) %s 2"print [fmt%i for i in product(ops,repeat=6) if eval(fmt%i)==2008][0]#result: (34 * 5 * 6 - 8 - 9 + 1) * 2
评论关闭