Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
8053 吴承熹 数字方阵 C++ Runtime Error 1999 MS 256 KB 839 2025-06-08 10:38:14

Tests(0/2):


Code:

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


Run Info:

Runtime Error:[ERROR] A not allowed system call.
Call ID:275