Box It!

  • + 0 comments

    ![](class Box { private: int l,b,h; public:

        Box(){ l = b = h = 0; }
        Box(int a, int b, int c)
        {
            l = a;
            this->b = b;
            h = c;
        }
        Box(Box &B)
        {
            l = B.l;
            b = B.b;
            h = B.h;
        }
    
        int getLength()  { return l; }
        int getBreadth() { return b; }
        int getHeight()  { return h; }
        long long CalculateVolume()    { return (long long)l*b*h; }
    
        bool operator<(Box &b)
        {
            if(l<b.l)
                return true;
            else if((this->b<b.b)&&(l == b.l))
                return true;
            else if(h<b.h && (l  == b.l)&&(this->b == b.b))
                return true;
            return false;
        }
    
        friend ostream& operator<<(ostream&, Box&);
    

    };

    ostream& operator<<(ostream &out, Box &b1) { out<https://)