Advertisement
gasaichan

Untitled

Apr 8th, 2018
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <clocale>
  3.  
  4. const int row = 10;
  5. const int column = 10;
  6.  
  7. int main() {
  8. setlocale(LC_ALL, "Russian");
  9.  
  10. int arr[row][column];
  11. int zeros[column];
  12.  
  13. for (int i = 0; i < column; i++) {
  14.     zeros[i] = 0;
  15. }
  16.  
  17. int zeros_number;
  18.  
  19. for  (int i = 0; i < row; i++) {
  20.     for (int j = 0; j < column; j++) {
  21.         arr[i][j] = rand()%10 - 4;
  22.         if (arr[i][j] == 0) { zeros[j]++; }
  23.         std::cout << arr[i][j] << "\t";
  24.     }
  25.     std::cout << std::endl;
  26. }
  27.  
  28. std::cout << std::endl;
  29.  
  30. for (int i = 0; i < column; i++) {
  31.     std::cout << zeros[i] << "\t";
  32. }
  33.  
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement