Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,m,k,a[50][50],x,y,i,j,s,l;
  8. ifstream fin("salut lipseste baluta.in");
  9. ofstream fout("salut lipseste baluta.out");
  10. fin>>n;
  11. fin>>m;
  12. fin>>k;
  13. for(i=1;i<=n;i++)
  14. for(j=1;j<=n;j++)
  15. a[i][j]=0;
  16. for(i=1;i<=m;i++)
  17. {
  18.  
  19. cout<<"x="; cin>>x;
  20. cout<<"y="; cin>>y;
  21. a[x][y]=1;
  22. a[y][x]=1;
  23. }
  24. for(i=1;i<=n;i++)
  25. {
  26. for(j=1;j<=n;j++)
  27. {
  28. cout<<a[i][j]<<" ";
  29. }
  30. cout<<endl;
  31. }
  32. cout<<endl;
  33. cout<"l="; cin>>l;
  34. for(i=1;i<=1;i++)
  35. {
  36. fin>>k[i];
  37. }
  38.  
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement