Advertisement
egormerk

second

Apr 23rd, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int N, a[100][100], sum = 0;
  8.     cin >> N;
  9.     for (int i = 0; i < N; i++) {
  10.         for (int k = 0; k < N; k++) {
  11.             cin >> a[i][k];
  12.             if (i%2== 0) sum+=a[i][k];
  13.         }
  14.     }
  15.     cout << sum;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement