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