| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 155309 | 王培臻 | 矩阵对角线 | C++ | Compile Error | 0 MS | 0 KB | 369 | 2026-06-06 15:26:39 |
#include<bits/stdc++.h> using namespace std; int main() { long long a[1001][1001]; long long s,d; cin>>s>>d; for(int i=1;i<=s;i++){ for(int j=1;j<=n;j++){ cin>>a[i][j]; } } for(int j=1;j<=n;j++){ for(int i=1;i<=n;i++){ if(i==j){ cout<<a[j][i]+d<<" "; }else{ cout<<a[j][i]<<" "; } } cout<<endl; } return 0; }
Main.cc: In function 'int main()':
Main.cc:8:18: error: 'n' was not declared in this scope
for(int j=1;j<=n;j++){
^
Main.cc:12:17: error: 'n' was not declared in this scope
for(int j=1;j<=n;j++){
^