0001 #include<iostream> 0002 using namespace std; 0003 0004 #include <stdio.h> 0005 #include <stdlib.h> 0006 #include <string.h> 0007 #include "stack/stack.h" 0008 0009 #define QUEEN_MAX 20 0010 0011 typedef enum {Continuous, Step} RunMode; 0012 0013 extern RunMode runMode; //运行模式 0014 extern int nSolu; //解的总数 0015 extern int nCheck; //尝试的总次数 0016 0017 void place5Queens_BruteForce(); 0018 void displaySolution ( int* solu, int n ); 0019 bool collide ( int* solu, int k ); 0020 0021 void placeQueens ( int n, int k ); 0022 0023 void place2Queens(); 0024 void place3Queens(); 0025 void place4Queens(); 0026 void place5Queens();