#include <iostream>
using namespace std;
void asdf(int cnt, int cna)
{
 int arr[100][100];
 
 int num=1;

 
 int i,j;
 
 
 for(i=0; i<(cnt/2)+1; i++)
 
 {
 
  for(j=i;j<cnt-1;j++)
  
  {
   arr[i][j] = num++;
  }
  for(j=i+1;j<cnt-i;j++)
  {
   arr[j][cnt-i-1] = num++;
  }
  for(j=cnt-i-2;j>=i;j--)
  {
   arr[cnt-i-1][j] = num++;
  }
  for(j=cnt-i-2;j>=i+1;j--)
  {
  
   arr[j][i] = num++;
  }
 }

for(i=0;i<cnt;i++)
 
 {
 
  for(j=0;j<cnt;j++)
  {
  
   cout << arr[i][j] << "   "  ;
  
  }
  
  cout << endl;
 }
 
 cout << endl;
}

int main()
{int n;
int a;
while(1)
{

 cin >> n ;
 asdf(n);
 break;
}

 return 0;
}


이건 그냥 n*n이고

n*m, 그러니까 row하고 col하고 다르게 나올때 출력하려면 어떻게 고쳐야할까요
뭐 3*5 이런거는 어떻게하죠? 검색해도 그런건 안나옴..