Information
- ID
- 6916
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 1
- Tags
- # Submissions
- 66
- Accepted
- 44
- Uploaded By
#include using namespace std;
int n,m;
int a[105][105];
int main(){ cin >> n >> m; for (int i=1;i<=n;i++) for (int j=1;j<=m;j++) cin >> a[i][j];
int ans=0;
for (int i=1;i<=n;i++)
for (int j=1;j<=m;j++)
if (i==1||i==n||j==1||j==m)
ans += a[i][j];
cout << ans << endl;
}
By signing up a HFOJ universal account, you can submit code and join discussions in all online judging services provided by us.