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