#include <iostream>
using std::cout;
using std::endl;
struct Point
{
Point(const double x, const double y, const double z);
double x;
double y;
double z;
};
Point::Point(const double x, const double y, const double z) :
x(x), y(y), z(z)
{}
Point operator+(const Point& first, const Point& second)
{
return Point(first.x + second.x,
first.y + second.y,
first.z + second.z);
}
void print(const Point& p)
{
cout << "x: " << p.x << endl;
cout << "y: " << p.y << endl;
cout << "z: " << p.z << endl;
}
int main()
{
Point a(1.0, 2.0, 3.0);
Point b(0.1, 0.2, 0.3);
Point c = a + b;
print(c);
return 0;
}