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