Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
109798 | 小徐老师 | 拐角方阵 | C++ | Accepted | 1 MS | 268 KB | 637 | 2025-02-11 19:19:30 |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n + 1][n + 1]; // a[n][n] - 0, 0 (1, 1) for(int i = n; i >= 1; --i) //选择了第 i 行 和 第 i 列 { for(int j = n; j >= 1; --j) //遍历 该行的所有内容 和 该列的所有内容 { a[i][j] = a[j][i] = i; } } for(int i = 1; i <= n; ++i) // 选择第几行 { for(int j = 1; j <= n; ++j) // 选择该行 第几列 第i行 第j列 { cout << a[i][j] << ' '; } cout << endl; } return 0; }