Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
129582 陈奕涵 数字方阵 C++ Accepted 2 MS 276 KB 510 2025-08-29 13:48:47

Tests(2/2):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[10][10]={0},n,k; cin>>n; for(int k=0;k<n;k++){ for(int i=k;i<n-k;i++){ for(int j=k;j<n-k;j++) a[i][j]=k+1; } } for(int i=0;i<n;i++){ cout<<a[i][0]; for(int j=1;j<n;j++) cout<<" "<<a[i][j]; cout<<endl; } return 0; }