#include <iostream>
using namespace std;
union point {
int decimal;
double _float;
void init() {
cin >> _float;
if ((int) _float == _float) {
decimal = (int) _float;
}
}
double get() {
if (_float != NULL) return _float;
return decimal;
}
};
struct points {
point value;
};
void insert(points &point){
cout << "Input x: ";
point.value.init();
}
int main() {
struct points x;
insert(x);
cout << "x = " << x.value.get() << ";";
}