Advertisement
Josif_tepe

Untitled

Apr 16th, 2021
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n, m;
  8.     cin >> n >> m;
  9.     int matrica[n][m];
  10.     for (int i = 0; i < n; i++)
  11.     {
  12.         for (int j = 0; j < m; j++)
  13.         {
  14.             cin >> matrica[i][j];
  15.         }
  16.     }
  17.     int proizvod = 1;
  18.     for (int i = 0; i < n; i++)
  19.     {
  20.         proizvod *= matrica[i][i];
  21.     }
  22.     cout << proizvod << endl;
  23.     if (proizvod % 2 == 0)
  24.     {
  25.         cout << "DA" << endl;
  26.     }
  27.     else {cout << "NE" << endl;}
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement