Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a[100][100], n, m, d[100];
- void citire(int& n, int& m, int a[][100])
- {
- cin >> n >> m;
- for (int i = 0; i < n; i++)
- for (int j = 0; j < m; j++)
- cin >> a[i][j];
- }
- int nrnule(int n, int m, int a[][100],int i)
- {
- int k = 0;
- for (int j = 0; j < m; j++)
- if (!a[i][j])
- k++;
- return k;
- }
- void calcul(int n, int m, int a[][100])
- {
- for (int i = 0; i < n; i++)
- d[i] = nrnule(n, m, a, i);
- }
- int main()
- {
- citire(n, m, a);
- calcul(n, m, a);
- int maxi = d[0];
- for (int i = 0; i < m; i++)
- if (d[i] > maxi)
- maxi = d[i];
- for (int i = 0; i < n; i++)
- if (d[i] == maxi)
- cout << i << ' ';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement