题目描述
blablabla
样例
blablabla
算法1
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla
算法2
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int a;
while (cin >> a, a) {
int t = (a + 1) / 2;
double c = (a - 1) / 2.0;
for (int i = 0; i < a; i++) {
for (int j = 0; j < a; j++) {
int x = t - floor(max(abs(i - c), abs(j - c)));
cout << x << " ";
}
cout << endl;
}
cout << endl;
}
return 0;
}