The point is given with its and coordinates: .
Two points , and an integer are given. Add them.
- Adding two points means to add the corresponding coordinates: (1, 2) + (3, 4) = (4, 6).
- Adding point and a number means to add a number to both point coordinates: (1, 2) + 10 = (11, 12).
Write the code according to the next interface:
class Point public: int *x, *y; Point(int x = 0, int y = 0); // Constructor void Read(void); // Read the point coordinates void Print(void); // Print the point coordinates Point operator +(const Point a); // Overload operator +: return the sum of two points Point operator +(int value); // Overload operator +: return the sum of point and an integer ;
The first line contains the coordinates and of the first point. The second line contains the coordinates and of the second point. The third line contains an integer . All values do not exceed by the absolute value.
Print the sum of two points and a number.
Example 1