Question: complete 1 dimension 8 queen problem using the given format you cannot add anything extra within the main function other that the already given code
complete 1 dimension 8 queen problem using the given format you cannot add anything extra within the main function other that the already given code blocks (such as bool !!!! something !!!) and the problem must be without goto statement
#include
bool ok(int q[], int c) { for (int i = 0; i < c; i++) { if (q[i] == q[c] || c - i == abs(q[i] - q[c])) { return false; } } return true; }
void goBack(int c){ }
void print(int q[]) { }
int main() { int q[8] = {0}; int c = 0; while ( ) { if ( ) { } else if () { } else if () { } else { } } return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
