小说网 找小说 无限小说 烟雨红尘 幻想小说 酷文学 深夜书屋

Nine Digits Expression

Problem:

 

Insert + ,-,*,/ signs as necessary in the string 123456789 to form an expression that evaluates to a certain number.

 

Answer:

 

 

It returns:

 

Solutions 1:    1*2345*6/7+8-9=2009
Solutions 2:    1/2*3*4*5*67+8-9=2009
Solutions 3:    1*2/3*45*67+8-9=2009
3 solutions were found!

 

Solutions 1:    9*8-7+6*54*3*2*1=2009
Solutions 2:    9+8*7+6*54*3*2*1=2009
Solutions 3:    9*8-7+6*54*3*2/1=2009
Solutions 4:    9+8*7+6*54*3*2/1=2009
4 solutions were found!

posted on 2009-02-18 01:31  王峰炬  阅读(116)  评论(0编辑  收藏  举报

导航