Run ID:83278
提交时间:2024-07-14 11:47:59
#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; }