Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<fstream>
- #include<cmath>
- #include<algorithm>
- using namespace std;
- ifstream f("adiacenta1.in");
- ofstream g("adiacenta1.out");
- int a[101][101],i,j,x,y,max1;
- int main()
- {
- max1=0;
- while(f>>x>>y)
- {
- a[x][y]=a[y][x]=1;
- if(x>max1||y>max1)
- max1=max(x,y);
- }
- for(i=1;i<=max1;i++)
- {
- for(j=1;j<=max1;j++)
- g<<a[i][j]<<" ";
- g<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement