4DM3M

ОАиП 6 вариант 6 пр

Nov 24th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. void main()
  4. {
  5.     const int nn = 50;
  6.     setlocale(LC_ALL, "");
  7.     int a[nn][nn], i, j, s, k=0, n;
  8.     cout << "Введите порядок матрицы:\n";
  9.     cin >> n;
  10.     cout << "Введите матрицу:\n";
  11.     for (i = 0; i < n; i++)
  12.         for (j = 0; j < n; j++)
  13.             cin >> a[i][j];
  14.  
  15.     for (i = 0; i < n; i++)
  16.     {
  17.         s = 0;
  18.         for (j = 0; j < n; j++) s += abs(a[i][j]);
  19.         if (s > 1) ++k;
  20.     }
  21.    
  22.     cout << "k=" << k << endl;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment