Advertisement
Carnby1021

Untitled

Nov 18th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. #include<sstream>
  4.  
  5. using namespace std;
  6.  
  7. class matrix
  8. {
  9. int*wsk;*temp;
  10. int x,y;
  11. public:
  12. void create_matrix(){
  13. wsk=new int[x];
  14. for(int i=0;i<x;i++){
  15. wsk[i]=new int[y];
  16. }
  17. for(int i=0;i<x;i++){
  18. for(int j=0;j<y;j++){
  19. wsk[i][j]=0;
  20. }
  21. }
  22. matrix(int_x,int_y){
  23. this->x=_x;
  24. this->y=_y;
  25. }
  26. }
  27. }
  28. void change_element(){
  29. int a,b;
  30. cout<<"write coordination x,y";
  31. cin>>a;
  32. cin>>b;
  33. int value;
  34. cout<<"give new valuse";
  35. cin>>value;
  36. wsk[a][b]=value;
  37. }
  38. string representation(){
  39. int a,b;
  40. string element;
  41. cout<<"write x,y:";
  42. cin>>a;
  43. cin>>b;
  44. ?????????????????? a;/////////////////////////////
  45. a<<wsk[a][b];
  46. element=?????.str();/////////////////////////////
  47. return element;
  48. }
  49. void add1(){
  50. for(int i=0;i<x;i++){
  51. for(int j=0;j<x;j++){
  52. wsk[i][j]++;
  53. }
  54. }
  55.  
  56. }
  57. void transponuj(){
  58. temp=new int[y];
  59. for(int i=0;i<y;i++){
  60. temp[y]=new int[x];
  61. }
  62. }
  63.  
  64. for(int i=0;i<x;i++){
  65. for(int j=0;j<y;j++){
  66. wsk[i][j]=temp[j][i]'
  67. }
  68. }
  69. if(x!=y){
  70. wsk=new int[y];
  71. for(int i=0;i<y;i++){
  72. wsk[i]=new int[x];
  73. }
  74. for(int i=0;i<x;i++0){
  75. for(int j=0;j<y;j++0){
  76. wsk[i][j]=temp[i][j];
  77. }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement