Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158282 王慕哲 方阵填数 C Compile Error 0 MS 0 KB 760 2026-08-20 17:57:33

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; int a[101][101]; int n=1; int t=0,b=N-1,l=0,r=N-1; while(n<=N*N){ for(int i=r;i>=l && n<=N*N;i--){ a[i][b]=n; n++; } r--; for(int i=r;i>=l && n<=N*N;i--){ a[b][i]=n; n++; } b--; for(int i=b;i>=t && n<=N*N;i--){ a[i][l]=n; n++; } l++; for(int i=l;i<=r && n<=N*N;i++){ a[t][i]; n++; } t++; } for(int i=1;i<=N;i++){ for(int j=1;j<=N;j++){ cout<<a[i][j]<<" "; } cout<<endl; } return 0; }


Run Info:

Main.c:1:24: fatal error: bits/stdc++.h: No such file or directory
 #include
                        ^
compilation terminated.