STANAANDREY

sb prog 16

Feb 24th, 2022 (edited)
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. ifstream fin("adiacent.txt");
  5. ofstream fout("complet.txt");
  6. int n, a[51][51];
  7.  
  8. int main() {
  9.     fin >> n;
  10.     for (int i = 1; i <= n; i++) {
  11.         for (int j = 1; j <= n; j++) {
  12.             fin >> a[i][j];
  13.         }
  14.     }
  15.  
  16.     int ok = 1;
  17.     for (int i = 2; i <= n; i++) {
  18.         for (int j = 1; j < i; j++) {
  19.               ok = ok && a[i][j];
  20.         }
  21.     }
  22.     cout << "Graful ";
  23.     if (!ok) {
  24.         cout << " nu ";
  25.     }
  26.     cout << "e complet!";
  27.     return 0;
  28. }
  29.  
Add Comment
Please, Sign In to add comment