You are on page 1of 3

class Box

{
    int l;
    int b;
    int h;

    public: 
    Box()
    {
        l=0;
        b=0;
        h=0;
    }
     Box(int length,int breadth, int height)
    {
        length=l;
        breadth=b;
        height= h;
    }
    Box(const Box& B)
    {
        l=B.l;
        b=B.l;
        h=B.l;
    }
    int getLength()
    {
        return l;
    }
    int getBreadth()
    {
        return b;
    }
    int getHeight()
    {
        return h;
    }
    long long CalculateVolume()
    {
        return (long long)l*b*h;
    }
    bool operator < (Box& A,const Box& B)
    {
        if((A.l<B.l)||((A.b<B.b)&&(A.l==B.l))||
((A.h<B.h)&&(A.b==B.b)&&(A.l==B.l)))
    {
        return true;
    }
    else
        return false;
    }
    ostream& operator<< (ostream& out, const Box& 
B)
    {
        out<<B.l<<" "<<B.b<<" "<<B.h;
        return out;
    }
   
    
};

You might also like