Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
132131 李馥甄 外围元素之和 C++ Accepted 2 MS 268 KB 275 2025-10-06 16:36:39

Tests(10/10):


Code:

#include <bits/stdc++.h> using namespace std; int a[21][21]; int main(){ int n,m; cin>>n>>m; int sum=0; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cin>>a[i][j]; if(i==1||i==n||j==1||j==m){ sum+=a[i][j]; } } } cout<<sum; return 0; }