#include <iostream>
using namespace std;
union coordinate {
int integer;
double _double;
void init() {
cin >> _double;
if ((int) _double == _double) {
integer = (int) _double;
}
}
double get() {
if (_double != NULL) return _double;
return integer;
}
};
struct coordinate_system {
coordinate x;
coordinate y;
};
struct another_system {
coordinate x;
coordinate y;
};
int main() {
struct coordinate_system point;
struct another_system point2;
cout << "Enter value of x for point: ";
point.x.init();
cout << "Enter value of y for point: ";
point.y.init();
cout << "Entered data:" << endl << "x = " << point.x.get() << "; y = " << point.y.get() << endl;
point2.x = point.x;
point2.y = point.y;
cout << "Copied data:" << endl << "x = " << point2.x.get() << "; y = " << point2.y.get() << endl;
}