Solution C ++ job 02

xiaoxiao2021-03-06  118

// Harry Zou #include #include #include #include using namespace std; int i = 0; char ch; const Int w = 8; int count = 0; int Map [W]; BOOL MOVE (INT X, INT Y) {i ; MAP [x] [Y] = i; count ; if (i == w * w) return true;

// 1 IF (x-2> = 0 && y 1 = 0 && y 2

// 3 IF (x 1 = 0) {IF (MAP [x 2] [Y-1] == 0) {IF (Move (x 2, y-1 )) Return True;}} // 7 if (x-1> = 0 && y-2> = 0) {IF (MAP [X-1] [Y-2] == 0) {IF (Move (X-1) , Y-2)) Return True;}} // 6 IF (x 1 = 0) {IF (MAP [X 1] [Y-2] == 0) {IF (Move X 1, Y-2)) Return True;}}

// 8 IF (x-2> = 0 && y-1> = 0) {IF (MAP [X-2] [Y-1] == 0) {IF (Move (X-2, Y-1)) Return True;}}

Map [x] [y] = 0; I -; Return False;}

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

New Post(0)