// Program by Akash Tripathi (@proakash256)
/* n = 4
4444444
4333334
4322234
4321234
4322234
4333334
4444444
*/
#include <stdio.h>
#include <math.h>
int Find_Max(int a , int b)
{
if(a > b)
return a;
else
return b;
}
int main()
{
int n;
scanf("%d", &n);
int len = (n * 2) - 1;
for(int i = 1; i <= len; i = i + 1)
{
for(int j = 1; j <= len; j = j + 1)
{
printf("%d " , Find_Max(abs(i - n) ,
abs(j - n)) + 1);
}
printf("\n");
}
return 0;
}
Comments
Post a Comment