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