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