#include #include #include using namespace std; int matrix_count=0; int vectors_count=0; class vector { private: int *x; int size_vector; public: vector() { const int size=5; size_vector=size; x=new int[size_vector]; for(int i=0; ix=new int[other.size_vector]; for(int i=0; ix[i]=other.x[i]; } ++vectors_count; } void operator = (const vector &other) { this->size_vector=other.size_vector; if(this->x != nullptr ) { delete[] this->x; } this->x=new int[other.size_vector]; for(int i=0; ix[i]=other.x[i]; } } vector &operator ~() { for(int i=0; isize_vector; i++) { this->x[i]=~(this->x[i]); } return *this; } bool operator!=(const vector &other) { for(int i=0; isize_vector; i++) { if(this->x[i]!=other.x[i]) return true; else return false; } } vector& operator -() { for(int i=0; isize_vector; i++) { this->x[i]=-(this->x[i]); } return *this; } /* vector operator+(const vector &other) { for(int i=0; isize_vector; i++) { this->x[i] = this->x[i]+other.x[i]; } return *this; } */ void print() { for (int i=0; isize_vector; i++) { cout<arr=new vector[other.vector_count]; for(int i=0; iarr[i]=other.arr[i]; } ++matrix_count; } void operator = (const matrix &other) { this->vector_count=other.vector_count; if(this->arr != nullptr) { delete[] this->arr; } this->arr=new vector[other.vector_count]; for(int i=0; iarr[i]=other.arr[i]; } } matrix &operator ++() { vector *temp=new vector[this->vector_count]; for(int i=0; ivector_count; i++) { temp[i]=arr[i]; } delete[] this->arr; ++vector_count; arr=new vector[vector_count]; for(int i=0; i<(this->vector_count)-1; i++) { arr[i]=temp[i]; } delete[] temp; return *this; } matrix &operator --() { vector *temp=new vector[this->vector_count]; for(int i=0; ivector_count; i++) { temp[i]=arr[i]; } delete[] this->arr; --vector_count; arr=new vector[vector_count]; for(int i=0; i<(this->vector_count)-1; i++) { arr[i]=temp[i]; } delete[] temp; return *this; } bool operator !() const { if(this->vector_count != 0) return true; else return false; } matrix &operator~() { for(int i=0; ivector_count; i++) { this->arr[i]=~(this->arr[i]); } return *this; } matrix &operator-() { for(int i=0; ivector_count; i++) { return (-arr[i]); } } /* matrix& operator+(const matrix &other) { for(int i=0; ivector_count; i++) { this->arr[i] = this->arr[i]+other.arr[i]; } return *this; } */ int getSize() { return vector_count; } friend ostream& operator<<(ostream &out, const matrix &other); ~matrix(){--matrix_count; delete[] arr;} }; ostream &operator<<(ostream &outs, const matrix &other) { for(int i=0; i