#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int a[16][16];
int main(int argc, char* argv[]) {
int n, i, j;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
a[i][1] = a[i][i] = 1;
for (j = 2; j < n; j++)
a[i][j] = a[i - 1][j] + a[i - 1][j - 1];
}
for (i = 1; i <= n; i++)
for (j = i + 1; j <= n; j++)
a[i][j] = a[n - i + 1][n - j + 1];
for (i = 1; i <= n; i++)
for (j = 1; j <= n; j++)
printf("%d%c", a[i][j], j == n ? '\n' : ' ');
return 0;
}
|