Advertisement
Mirbek

Города и дороги

Jan 8th, 2022
729
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. const int N = 105;
  6.  
  7. int n;
  8. int a[N][N];
  9.  
  10. int main(){
  11.     cin >> n;
  12.  
  13.     int cnt = 0;
  14.     for (int i = 1; i <= n; i++) {
  15.         for (int j = 1; j <= n; j++) {
  16.             cin >> a[i][j];
  17.             cnt = cnt + a[i][j];
  18.         }
  19.     }
  20.  
  21.     cout << cnt / 2 << endl;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement