| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 154499 | 李折曦 | 外围元素之和 | C++ | Compile Error | 0 MS | 0 KB | 336 | 2026-05-30 14:33:41 |
#include <bits/stdc++.h> using namespace std; int main (){ int a[11][11]; int n,m; cin>>n>>m; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cin>>a[i][j]; } } for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ if(i==1 or i==n or j==1 or j==m){ sum+=a[i][j]; } } } cout<<sum; return 0; }
Main.cc: In function 'int main()':
Main.cc:17:5: error: 'sum' was not declared in this scope
sum+=a[i][j];
^
Main.cc:21:8: error: 'sum' was not declared in this scope
cout<