80分,求解答
查看原帖
80分,求解答
856315
lsy_bc_slyx楼主2023/5/7 21:14
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,m,a[101][101],s=0;
	cin>>m>>n;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			cin>>a[n][m];
			if(i==1||i==n)s+=a[n][m];
			else if(j==1||j==m)s+=a[n][m];
		}
	}
	cout<<s;
    return 0;
}
2023/5/7 21:14
加载中...