Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream fin("adiacent.txt");
- ofstream fout("complet.txt");
- int n, a[51][51];
- int main() {
- fin >> n;
- for (int i = 1; i <= n; i++) {
- for (int j = 1; j <= n; j++) {
- fin >> a[i][j];
- }
- }
- int ok = 1;
- for (int i = 2; i <= n; i++) {
- for (int j = 1; j < i; j++) {
- ok = ok && a[i][j];
- }
- }
- cout << "Graful ";
- if (!ok) {
- cout << " nu ";
- }
- cout << "e complet!";
- return 0;
- }
Add Comment
Please, Sign In to add comment