Polnochniy

Untitled

Nov 23rd, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. const int N = 3;
  4. const int P = 3;
  5. int main()
  6. {
  7. setlocale(LC_ALL, "Rus");
  8. int a[N][P];
  9. int k[N];
  10. cout << "Введите элементы матрицы . Найти количество нулевых элементов в с столбце " << endl;
  11. for (int i = 0; i < N; i++)
  12. {
  13. for (int j = 0; j < P; j++)
  14. {
  15. cin >> a[i][j];
  16. }
  17. cout << endl;
  18. }
  19. for (int i = 0; i < N; i++)
  20. {
  21.  
  22. for (int j = 0; j < P; j++)
  23. {
  24. cout << a[i][j] << "\t";
  25. k[i] = 0;
  26. }
  27. cout << endl;
  28. }
  29.  
  30. for (int i = 0; i < N; i++)
  31. {
  32. for (int j = 0; j < P; j++)
  33. {
  34. if (a[i][j] == 0 )
  35. {
  36. k[j]++;
  37. }
  38. }
  39. }
  40. cout << endl;
  41. for (int j = 0; j < P; j++)
  42. {
  43. cout << k[j] << "\t";
  44. }
  45. return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment