Advertisement
STANAANDREY

sb prog 17

Feb 25th, 2022
1,005
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. ifstream fin("matrice.in");
  5. int n, a[51][51];
  6.  
  7. void read() {
  8.     cin >> n;
  9.     for (int i = 0; i < n; i++) {
  10.         for (int j = 0; j < n; j++) {
  11.             cin >> a[i][j];
  12.         }
  13.     }
  14. }
  15.  
  16. int main() {
  17.     read();
  18.     int ok = 1;
  19.     for (int i = 0; i < n - 1; i++) {
  20.         for (int j = i + 1; j < n; j++) {
  21.             if (a[i][j] != a[j][i]) {
  22.                 ok = 0;
  23.             }
  24.         }
  25.     }
  26.     cout << (ok ? "DA" : "NU") << endl;
  27.     return 0;
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement