chess(line+size,cols,p_line,p_cols,size);
}
else{
printf("a[%d][%d]=1",line+size,cols+size-1);
a[line+size][cols+size-1]=1;
chess(line+size,cols,line+size,cols+size-1,size);
}
/*right below*/
if(p_line >= line+size && p_cols >= cols+size){
chess(line+size,cols+size,p_line,p_cols,size);
}
else{
printf("a[%d][%d]=1",line+size,cols+size);
a[line+size][cols+size]=1;
chess(line+size,cols+size,line+size,cols+size,size);
}
}
int main(){
int i=0,j=0;
for(;i<4;++i)
for(j=0;j<4;++j)
a[i][j]=0;
a[1][1]=1;
for(i=0;i<4;++i){
for(j=0;j<4;++j)
printf("%d",a[i][j]);
printf("\n");
}
printf("\n\n");
chess(0,0,1,1,4);
for(i=0;i<4;++i){
for(j=0;j<4;++j)
printf("%d",a[i][j]);
printf("\n");
}
exit(0);
}
/*analysize */
/*according this program ,we should have found that
* this skill have advantages in the solution of such problem
* put a big problem into many little steps
* follow the steps above we will reach the practicularly element ,and draw the element arount it*/