mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-08 02:13:51 +08:00
Update: Rename folder name to XSMOJ
This commit is contained in:
19
XSMOJ/计算矩阵边缘元素之和.cpp
Normal file
19
XSMOJ/计算矩阵边缘元素之和.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
using namespace std;
|
||||
int main(){
|
||||
int a,b,c=0,d[100][100];
|
||||
cin >>a>>b;
|
||||
for(int i=0;i<a;i++){
|
||||
for(int j=0;j<b;j++){
|
||||
cin >>d[i][j];
|
||||
if(i==0 || j==0 || i==(a-1) || j==(b-1)){
|
||||
c+=d[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
cout <<c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user