#ifndef __POS_H #define __POS_H #include using namespace std; class Pos { int x, y; public: int getx() { return x; } int gety() { return y; } Pos(); Pos(int, int); Pos operator+(Pos); friend ostream &operator<<(ostream &, Pos &); }; Pos::Pos(int x, int y) { this->x = x; this->y = y; } Pos::Pos() { x = 0; y = 0; } Pos Pos::operator+(Pos other) { return Pos(this->x + other.x, this->y + other.y); } ostream &operator<<(ostream &stream, Pos &pos) { stream << "(" << pos.x << ", " << pos.y << ")"; return stream; } #endif