Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int N = 3;
- const int P = 3;
- int main()
- {
- setlocale(LC_ALL, "Rus");
- int a[N][P];
- int k[N];
- cout << "Введите элементы матрицы . Найти количество нулевых элементов в с столбце " << endl;
- for (int i = 0; i < N; i++)
- {
- for (int j = 0; j < P; j++)
- {
- cin >> a[i][j];
- }
- cout << endl;
- }
- for (int i = 0; i < N; i++)
- {
- for (int j = 0; j < P; j++)
- {
- cout << a[i][j] << "\t";
- k[i] = 0;
- }
- cout << endl;
- }
- for (int i = 0; i < N; i++)
- {
- for (int j = 0; j < P; j++)
- {
- if (a[i][j] == 0 )
- {
- k[j]++;
- }
- }
- }
- cout << endl;
- for (int j = 0; j < P; j++)
- {
- cout << k[j] << "\t";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment