#include<iostream>
#include<cstdio>
using namespace std;
#define X 8 //定义棋盘
#define Y 8
int chess[X+1][Y+1];
int nextxy(int &x,int &y,int count){ //判断该棋盘格是否可以插入棋子
switch (count)
{
case 1:
if(x + 2 <= X && y - 1 >= 1 && chess[x+2][y-1] == 0){
x += 2;
y -= 1;
return 1;
};break;
case 2:
if(x + 2 <= X && y + 1 <= Y && chess[x+2][y+1] == 0){
x += 2;
y += 1;
return 1;
};break;
case 3:
if(x + 1 <= X && y - 2 >= 1 && chess[x+1][y-2] == 0){
x += 1;
y -= 2;
return 1;
};break;
case 4:
if(x + 1 <= X && y + 2 <= Y && chess[x+1][y+2] == 0){
x += 1;
y += 2;
return 1;
};break;
case 5:
if(x - 2 >