전 엄청 오래걸리던데요 ㅠㅠ;; 아래 소스 구현하는데 2~3주 가까이 된다는

#include <stdio.h>

#define Row 8
#define Col 8

void main()
{
 int dot[Row][Col]={0};
 int r=0,c=-1,re,Rcor=1,Ccor=1,mat,rre,inv=0,color=0;

 scanf("%d",&mat);

 for( re=0; re<2*mat-1; re++ )
 {
  if( re%2 )
   inv += 1;
  for( rre=inv; rre<mat; rre++ )
  {
   ( re%2 )? r += Rcor : c += Ccor;
   dot[r][c] = ++color;
  }
 ( re%2 )? Rcor *= (-1) : Ccor *= (-1);
 }

 for(r=0; r<8; r++)
 {
  for(c=0; c<8; c++)
   if(dot[r][c]!=0)
    printf("%d ",dot[r][c]);
  printf("n");
 }
}