Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
156901 赵奕杰 数字方阵 C++ Accepted 1 MS 272 KB 344 2026-07-11 13:22:13

Tests(2/2):


Code:

#include<bits/stdc++.h> using namespace std; int a[105][105]; int main(){ int n; cin>>n; for(int x=1;x<=(n+1)/2;x++){ for(int i=x;i<=n-x+1;i++){ for(int j=x;j<=n-x+1;j++){ a[i][j]=x; } } } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cout<<a[i][j]<<" "; } cout<<"\n"; } return 0; }