#include <bits/stdc++.h> using namespace std; //1186 、1187 int main() { int n; cin >> n; int a[20][20]={0}; for(int i=0;i<n;i++) { for(int j=0;j<=i;j++) { a[i-j][j] = i+1; a[n-1-(i-j)][n-1-j] = (2*n-1)-i; } } for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { cout <<setw(3)<<a[i][j]; } cout <<endl; } return 0; } /************************************************************** Problem: 1192 User: mariooo Language: C++ Result: Accepted Time:8 ms Memory:2072 kb ****************************************************************/