Advertisement
Pit_Anonim

D

Nov 25th, 2021
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main() {
  4.     int c = 0;
  5.     int a;
  6.     std::cin>>a;
  7.     int map[a][a];
  8.  
  9.  
  10.     for (int x = 0; x < a; x++)
  11.         for (int y = 0; y < a; y++) {
  12.             std::cin>>map[x][y];
  13.             if (map[x][y]) c++;
  14.         }
  15.  
  16.  
  17.  
  18.     std::cout<<c;
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement