Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
83278 石茂诤 外围元素之和 C++ Accepted 0 MS 280 KB 321 2024-07-14 11:47:59

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int a[101][101],x,y,s=0; int main(){ cin>>x>>y; for(int i=0;i<x;i++){ for(int j=0;j<y;j++){ cin>>a[i][j]; } } for(int i=0;i<x;i++){ for(int j=0;j<y;j++){ if(i==0||i==x-1||j==0||j==y-1){ s+=a[i][j]; } } } cout<<s; return 0; }