Writing a C++ version of the algebra game 24

前端 未结 7 1636
离开以前
离开以前 2021-01-02 12:48

I am trying to write a C++ program that works like the game 24. For those who don\'t know how it is played, basically you try to find any way that 4 numbers can total 24 th

7条回答
  •  情书的邮戳
    2021-01-02 13:42

    Look up the Knapsack problem (here's a link to get you started: http://en.wikipedia.org/wiki/Knapsack_problem), this problem is pretty close to that, just a little harder (and the Knapsack problem is NP-complete!)

提交回复
热议问题