Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream fin("graf1.in");
- ifstream fin1("graf2.in");
- ofstream fout("reuniune.out");
- ofstream fout1("intersectie.out");
- /// 4/175 manulal
- int n;
- int a[101][101], b[101][101];
- int I[101][101], R[101][101];
- int main()
- {
- int n, x, y;
- fin>>n;
- while(fin>>x>>y) a[x][y] = a[y][x] = 1;
- fin>>n;
- while(fin1>>x>>y) b[x][y] = b[y][x] = 1;
- for(int i=1;i<=n;++i, fout<<'\n', fout1<<'\n')
- for(int j=1;j<=n;++j)
- fout1<<(I[i][j] = a[i][j] & b[i][j])<<' ',
- fout <<(R[i][j] = a[i][j] | b[i][j])<<' ';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement