List of combinations of N balls in M boxes in C++

前端 未结 4 1914
野趣味
野趣味 2021-01-03 08:08

I would like to write a function that generate an array of tuples containing all possible permutations of N balls in M boxes in C++.

The order (Edit : in the resulti

4条回答
  •  攒了一身酷
    2021-01-03 08:49

    Actually there is one. Take a look at: http://photon.poly.edu/~hbr/boost/combinations.html

    It is not in boost but follows the same principles as is easily visible from the name.

提交回复
热议问题