| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 156591 | 李沐阳 | 外围元素之和 | C++ | Accepted | 1 MS | 276 KB | 367 | 2026-07-04 10:42:55 |
#include<bits/stdc++.h> using namespace std; int main() { int sum=0,n,m,a[21][21]; cin>>n>>m; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cin>>a[i][j]; } } for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(i==0||i==n-1){ sum+=a[i][j]; } else if(j==0||j==m-1){ sum+=a[i][j]; } } } cout<<sum<<endl; return 0; }