公式计算
#include <iostream>
using namespace std;
int main() {
int n;
while (cin >> n, n) {
for (int i = 0; i < n; i++) {
// 以(0,0)为坐标系原点,向下为y轴正方向,向右为x轴正方向
// 则穿过矩阵中相同数字的直线坐标方程为y = x + b
// 直线上的数字为到y轴的截距的绝对值加1,即 abs(i - j) + 1
for (int j = 0; j < n; j++) printf("%d ", abs(i - j) + 1);
printf("\n");
}
printf("\n");
}
return 0;
}