/**
5. Define a class Int having a single member of
class int. Define constructors, assignment, and
operators +, –, *, / for it. Test it, and
improve its design as needed
(e.g., define operators << and >> for convenient
I/O). */

#include<iostream>
using namespace std;

class Int {
private:
    int x;
public:
    Int() {}
    Int(int xin) : x(xin) {}
    int operator=(Int rho) {
        x=rho.x;
        return x;
    }
    int operator+(Int rho) {
        return x + rho.x;
    }
    int operator-(Int rho) {
        return x - rho.x;
    }
    int operator*(Int rho) {
        return x * rho.x;
    }
    int operator/(Int rho) {
        return x / rho.x;
    }
    void show() const { cout << x; }
    int get() const { return x; }
    void set(int xin) { x = xin; }
};

ostream& operator<<(ostream& os, const Int& xint) {
    os << xint.get();
    return os;
}

istream& operator>>(istream& is, Int& rho) {
    int xin;
    is >> xin;
    rho.set(xin);
    return is;
}

int main() {
    Int x{7};
    Int y{111};
    cout << "\nx = "; x.show();
    cout << "\ny = " << y
         << "\ny+x = " << y+x
         << "\ny-x = " << y-x
         << "\ny*x = " << y*x
         << "\ny/x = " << y/x;
    x = y;
    cout << "\nAfter x = y, x = " << x;
    Int z;
    cout << "\nEnter an Int: ";
    cin >> z;
    cout << "\nYou entered " << z;
}



