Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
149281 郑雨心 拐角方阵 C++ Compile Error 0 MS 0 KB 418 2026-03-08 18:28:03

Tests(0/0):


Code:

#include <iostream> using namespace std; int a[50][50]; int main() { int n,sum; cin>>n; for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++) { if(i==s||j>i) { a[i][j]=s; } } for(int z=i;z<=n;z++) { if(i==s||z>i) { a[z][i]=s; } } s++; } 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.cc: In function 'int main()':
Main.cc:12:10: error: 's' was not declared in this scope
    if(i==s||j>i)
          ^
Main.cc:19:10: error: 's' was not declared in this scope
    if(i==s||z>i)
          ^
Main.cc:24:3: error: 's' was not declared in this scope
   s++;
   ^
Main.cc:6:8: warning: unused variable 'sum' [-Wunused-variable]
  int n,sum;
        ^