Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a[101][101],n;
- void citire ()
- {
- int i,j;
- cin>>n;
- for(i=1;i<=n;i++)
- for (j=1;j<=n;j++)
- cin>>a[i][j];
- }
- bool adiacenta()
- {
- int i,j;
- for (i=1;i<=n;i++)
- for (j=1;j<=n;j++)
- {
- if (a[i][j]!=0 && a[i][j]!=1)
- return 0;
- if (a[i][j]!=a[j][i])
- return 0;
- if (i==j && a[i][j]!=0)
- return 0;
- }
- return 1;
- }
- int main()
- {
- citire();
- cout<<adiacenta();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement