Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n , m;
- cin >> n >> m;
- int a[105][105];
- for(int i = 1; i <= n; i++){
- for(int j = 1; j <= m; j++){
- cin >> a[i][j];
- }
- }
- int start_row , start_column , end_row , end_column;
- cin >> start_row >> start_column >> end_row >> end_column;
- int sum = 0;
- for(int i = start_row; i <= end_row; i++){
- for(int j = start_column; j <= end_column; j++){
- sum += a[i][j];
- }
- }
- cout << sum << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement