Chrysaor
asked on
List all possible combinations of x numbers taken y at a time , in C++
Is there a function or a library which has a function for this problem : I have x numbers (e.g 5) , and I want to list all possible combinations in of these numbers taken y (e.g 3) at a time. For example, let's say we have these 5 numbers: 1, 3, 5, 6, 7 , I want to print all the possible combinations taken 3 at time, which means 135, 356,567 etc etc.
If there is not such function, can you provide me the basic guidelines to build such a function? thanks a lot.
If there is not such function, can you provide me the basic guidelines to build such a function? thanks a lot.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
So is equal 135, 351, 531, 513 or do you count it like a diferent combination ?