#include "stdio.h" #define N 8 int w=0; int way1[8]={-2,-1,1,2, 2, 1,-1,-2}; int way2[8]={ 1,2, 2,1,-1,-2,-2,-1}; int ch[N*N]=; int a[N*N+1][3]=; int st=1; char c='y';
void print() { int x,y;
printf(" ------%d answer---- ",++w);
for(x=1;x<N+1;x++) { printf(" "); for(y=1;y<N+1;y++) printf("%2d ",ch[(x-1)*N+y-1]); printf(" "); } printf(" Press n to quit ,press any other key to continue. "); c=getchar(); /*询问是否继续输出结果*/ }
main() { int x,y,way; printf("Please enter the row and column of the starting point. "); scanf("%d,%d",&a[1][0],&a[1][1]);/*输入行数和列数*/ getchar(); /*接收回车符*/ x=a[1][0],y=a[1][1]; ch[(x-1)*N+y-1]=1; /*在ch数组中对相应点赋值*/