#include <stdio.h> #define MAX 27 void dfs(int i, int j); int dx[8] = {-1, 1, -2, 2, -2, 2, -1, 1}; int dy[8] = {-2, -2, -1, -1, 1, 1, 2, 2}; int marked[MAX][MAX]; //标记 int pathx[MAX]; int pathy[MAX]; int flag, step; int p,q; int main(void) { int n;…