Created
January 26, 2017 09:15
-
-
Save shawon100/37b76171e4df803ed38d51e792fc6193 to your computer and use it in GitHub Desktop.
Adjacent Matrix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() | |
| { | |
| int i,j,n,e,u,v,g[100][100]; | |
| cin>>n>>e; | |
| for(i=1;i<=e;i++) | |
| { | |
| cin>>u>>v; | |
| g[u][v]=1; | |
| } | |
| for(i=1;i<=n;i++) | |
| { | |
| for(j=1;j<=n;j++) | |
| { | |
| cout<<g[i][j]<<" "; | |
| } | |
| cout<<endl; | |
| } | |
| return 0; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment