trying to write a recursive function that counts the number of sequences that sum up to that number C++

后端 未结 6 1538
野趣味
野趣味 2021-01-20 02:01

Okay, so here is what I\'m trying to do. The user inputs a number. I\'m trying to write a recursive function that counts the number of sequences that sum up to that number (

6条回答
  •  一生所求
    2021-01-20 02:27

    These are called Integer Partitions, and there is a simple way to calculate the number of partitions of any number using an intermediate function. Take a look here: Integer Partition.

提交回复
热议问题