int x[8]={-1,1,2,2,1,-1,-2,-2};
int y[8]={2,2,1,-1,-2,-2,-1,1};
int count = 1;
void t_chees(int chees[][8],int start_x,int start_y){
int i ,j;
chees[start_x][start_y]=count;
for( i =0;i<8;i++){
if(count == 64) return;
if(start_x+x[i]>-1&&start_x+x[i]<8&&start_y+y[i]>-1&&start_y+y[i]<8
&&chees[start_x+x[i]][start_y+y[i]]==0){
count ++;
t_chees(chees,start_x+x[i],start_y+y[i]);
}
}
}
int main(int argc, char *argv[]) {
int chees[8][8];
int i ,j;
for(i= 0 ;i<8;i++){
for(j=0;j<8;j++){
chees[i][j] = 0;
}
}
t_chees(chees,0,0);
for(i= 0 ;i<8;i++){
for(j=0;j<8;j++){
printf(“%5d”,chees[i][j]);
}
printf(“\n”);
}
return 0;
}