#include<iostream>
usingnamespace std;
int main()
{
int n;
cout<<"Enter a number: ";
cin>>n;
cout<<"The table is "<<n<<" x "<<n<<endl<<endl;
int x=n/2,y=0,i,j;
int grid[n][n];
for (i=1;i<=n*n;++i)
{
grid[y][x]=i;
x++;
y--;
if (i%n==0)
{
y+=2;
--x;
}else{
if (x==n)
{
x=0;
}elseif (y<0){
y+=n;
}
}
}
system("pause");
}