#include<iostream>
#include<string>
using namespace std;
int arry[21][21];voidswap(int *i, int*j){
int temp;
temp =*i;*i =*j;*j = temp;}voidfanzhuan(int row){for(int i =0; i < row /2; i++){swap(&arry[row][20- row + i],&arry[row][20- i]);}}
int main(){
int num =1;memset(arry,0,sizeof(arry));for(int i=0;i<21;i++){for(int j=0;j<=i;j++)
arry[i][20- i+j]= num++;if(i %2!=0){fanzhuan(i);}}
int kongge =1;//空格的个数
int jishu =0;for(int i =0; i <21; i++){for(int j =0; j <21; j++){printf("%4d", arry[i][j]);}
cout << endl;}return0;}