ところてん #4728(2007/12/10 17:24 GMT) [ Python ] Rating0/0=0.00
pythonでナイーブな実装。 括弧なしで101個でした。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
def komachi(): num = range(1,10) ope = ["",".0+",".0-",".0*",".0/"] c = 1 for x in xrange(5**8): formula = str(num[0]) for n in range(1,9): formula += ope[x%5] + str(num[n]) x /= 5 if eval(formula) == 100: print formula,c c += 1 komachi()
Rating0/0=0.00-0+
[ reply ]
ところてん
#4728()
[
Python
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]