Many netizens posted asking questions such as: the eight queen issues, lottery problems (select N (m> = n) from the M center), etc., in fact, this can be incatenated as a problem of arranging combination. Solving such problems, using for loop nested is unrealistic (only programmed for the specified M, N, and the program looks abnormally cumbersome), the better method is to return to the law. The C / C description of the general algorithm for such problems is given below: int COMBINE (int A [】, int sub) {// a [1 ..?] Means candidate set, SUB represents an elements arranged (combined) Number {INT TOTAL = SIZEOF (A); int Order [SUB 1]; int count = 0; // Multiple ORDER [0] = - 1; for (INT i = 1; i <= sub; i ) Order [i] = i; int K = Sub; Bool flag = true; while (ORDER [0]! = - 1) {if (flag) {for (i = 1; i <= Sub; i ) // Output Composite Printf ("% D", A [ORDER [ORDER [ORDER [I]]); Printf ("/ N"); count ; flag = false;} Order [k] ; if (Order [K] == Total 1) {ORDER [K -] = 0; Continue;} ... // Added Order [k] restrictions // If the condition is satisfied, then execute / / Otherwise constinue; if (k