Guest User

Untitled

a guest
May 27th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. // Так будет выглядить класс где задаётся матрица ....
  2.  
  3.  
  4. class Matrix {
  5. private:
  6. int nstr,nstl;
  7. int **a;
  8. public:
  9. Matrix (int m,int n);
  10. ~Matrix ();
  11. // Сюда надо написать название методов которые будешь писать и использовать
  12. };
  13.  
  14. Matrix::Matrix (int m,int n)
  15. {
  16. nstr=m;
  17. nstl=n;
  18. a=new int *[nstr];
  19. for (int j=0;j<nstr;j++)
  20. {
  21. a[j]=new int[nstl];
  22. for (int i=0;i<nstl;i++)
  23. a[j][i]=rand()%;
  24. }
  25. }
  26.  
  27. Matrix::~Matrix()
  28. {
  29. for (int i=0;i<nstr;i++)
  30. delete []a;
  31. }
  32.  
  33.  
  34. // Сюда пиши реализацию тех методов которые ввёл в классе
Add Comment
Please, Sign In to add comment