Next problem

xiaoxiao2021-03-13  162

Put the code first, there is no time. Write slowly when you have time

#include "math.h" int sum = 0; int 1, INT i); Void Queen (int x [】, int N, int T); void queen2 (int x [】, INT N) void main () {INT X [8], T; SUM = 0; Queen (X, 8, 0); Printf ("% D / N", SUM); SUM = 0; Queen2 (x, 8); Printf ("2:% D / N", SUM);

Void Queen2 (int x [], int N) // Non-recursive backtrack {INT T = 0, i; x [t] = - 1; while (t> -1) {x [t] = 1; while X [t] = n-1 && plane (x, t) == 0) x [t] = 1; IF (x [t] = n) {SUM ; return;} for (i = 0; i

INT J; for (j = 0; j

转载请注明原文地址:https://www.9cbs.com/read-129061.html

New Post(0)