One way to approach it:
Have a for loop from 0 to 2^digits -1.
For each value, do a bitwise and against 1,2,4,8,etc, counting the number of results that are 1. Sum the results (to count the number of 1's) and also concatenate the IntToStrings of the results(to build a string to display). If the sum is 2, then print the string.
|