//sisaldab ka ülesannnet 3-1 #include using namespace std; class TThreeD { private: int x; int y; int z; public: TThreeD(void){ x=y=z=0; } TThreeD( int _x, int _y, int _z){ x=_x, y=_y; z=_z; } TThreeD operator+(TThreeD op2); // Operator op1 is the object itself TThreeD operator=(TThreeD op2); // Operator op1 is the object itself TThreeD operator++(); TThreeD operator--(); TThreeD operator++(int notused); TThreeD operator--(int notused); void Show(void); }; // Prefix operator ++ TThreeD TThreeD::operator++() { x++; y++; z++; return *this; } // Overload ++ postfix version TThreeD TThreeD::operator++(int notused) { TThreeD Tmp = *this; x++; y++; z++; return Tmp; } //Prefix operator -- TThreeD TThreeD::operator--() { x--; y--; z--; return *this; } // Overload -- postfix version TThreeD TThreeD::operator--(int notused) { TThreeD Tmp = *this; x--; y--; z--; return Tmp; } // Overloading + TThreeD TThreeD::operator+(TThreeD op2) { TThreeD Tmp; Tmp.x = x + op2.x; Tmp.y = y + op2.y; Tmp.z = z + op2.z; return Tmp; } // Overloading = TThreeD TThreeD::operator=(TThreeD op2) { x = op2.x; y = op2.y; z = op2.z; return *this; } // Member function Show() void TThreeD::Show(void) { cout << "Coordinates: "; cout << x << ", "; cout << y << ", "; cout << z << endl; } int main(void) { TThreeD A(10, 20, 30); TThreeD B(10, -10, 10); TThreeD C; cout<<"Teen nüüd C=A+B; "<