Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- ifstream f("adiacenta.in");
- ofstream g("adiacenta.out");
- int i,j,k,v[1001],ok,a[1001][101],n,m,x,y;
- int main()
- {
- f>>n>>m;
- for(x=1; x<=m; x++)
- {
- f>>i>>j;
- a[i][j]=a[j][i]=1;
- }
- for(i=1; i<=n; i++)
- {
- for(j=1; j<=n; j++)
- g<<a[i][j]<<" ";
- g<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement