0001 #include "queen.h" 0002 0003 void displaySolution ( int* solu, int n ) { //输出n*n的可行布局 0004 ( Step == runMode ) ? system ( "cls" ) : printf ( "--\n" ); 0005 for ( int i = 0; i < n; i++ ) { 0006 for ( int j = 0; j < n; j++ ) { 0007 printf ( ( j == solu[i] ) ? "█" : "[]" ); 0008 } 0009 printf ( "\n" ); 0010 } 0011 if ( Step == runMode ) { 0012 cout << nSolu << " solution(s) found after " << nCheck << " check(s)\a"; 0013 getchar(); 0014 } else 0015 printf ( "\n" ); 0016 }