Guest User

Untitled

a guest
Feb 19th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. friend istream& operator >> (istream &in, Matrix &mas)
  2. {
  3. for (int i = 0; i < mas.n; i++)
  4. {
  5. for (int j = 0; j < mas.m; j++)
  6. {
  7. in >> mas.mas[i][j];
  8.  
  9. }
  10. }
  11. return in;
  12. }
  13.  
  14. class Matrix
  15. {private:
  16. int n, m, **mas;
  17. public:
  18. Matrix (int n, int m)
  19. {
  20. int**mas = new int*[n];
  21. for (int i = 0; i < n; i++)
  22. {
  23. mas[i] = new int[m];
  24. }
  25. for (int i = 0; i < n; i++)
  26. for (int j = 0; j < m; j++)
  27. mas[i][j] = 0;
  28. }
  29.  
  30. Matrix (int n, int m) : n(n), m(m)
  31. {
  32. mas = new int*[n];
  33. ...
Add Comment
Please, Sign In to add comment