Advertisement
myloyo

6.4.6

Nov 28th, 2022 (edited)
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <algorithm>
  4. #include <cmath>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     int n, c;
  11.     cin >> n;
  12.     int b[101][101];  
  13.     int *a = new int[n];
  14.     for (int i = 0; i < n; i++) {
  15.         c = 0;
  16.         for (int j = 0; j < n; j++) {
  17.             cin >> b[i][j];
  18.             if (b[i][j] >= 0) {
  19.                 c++;
  20.             }
  21.         }
  22.         a[i] = c;
  23.     }
  24.     for (int i = 0; i < n; i++) {
  25.         cout << a[i] << " ";
  26.     }
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement