Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139422 万骏博 外围元素之和 C++ Accepted 0 MS 284 KB 337 2025-12-06 17:07:47

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int a[101][101],n,o=0,m; int main(){ scanf("%d%d",&n,&m); for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ scanf("%d",&a[i][j]); if(i==1||i==n){ o+=a[i][j]; } else{ if(j==m||j==1){ o+=a[i][j]; } } } } printf("%d",o); return 0; }