0001 #include "queen_brute_force_1/queen.h" 0002 0003 void place2Queens() { //2ʺ֦㷨 0004 int solu[2]; //ⷨ 0005 for ( solu[0] = 0; solu[0] < 2; solu[0]++ ) 0006 if ( !collide ( solu, 0 ) ) 0007 for ( solu[1] = 0; solu[1] < 2; solu[1]++ ) 0008 if ( !collide ( solu, 1 ) ) { 0009 nSolu++; displaySolution ( solu, 2 ); 0010 } 0011 }