(
inti = 0; i < n; i++) {
41 for(
intj = 0; j < n; j++) {
42std::cout <<
""<< board[i][j] <<
" ";
58bool isSafe(
conststd::array<std::array<int, n>, n> &board,
const int&row,
63 for(i = 0; i < col; i++) {
70 for(i = row, j = col; i >= 0 && j >= 0; i--, j--) {
76 for(i = row, j = col; j >= 0 && i < n; i++, j--) {
91void solveNQ(std::array<std::array<int, n>, n> board,
const int&col) {
99 for(
inti = 0; i < n; i++) {
122std::array<std::array<int, n>, n> board = {
123std::array<int, n>({0, 0, 0, 0}), std::array<int, n>({0, 0, 0, 0}),
124std::array<int, n>({0, 0, 0, 0}), std::array<int, n>({0, 0, 0, 0})};
void solveNQ(std::array< std::array< int, n >, n > board, const int &col)
void printSolution(const std::array< std::array< int, n >, n > &board)
bool isSafe(const std::array< std::array< int, n >, n > &board, const int &row, const int &col)
int main()
Main function.
Functions for Eight Queens puzzle.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4