#include <iostream>
using namespace std;
class box{
public :
box( int a = 0 , int b = 0 , int c = 0 ) : h( a) , l( b) , w( c) { }
double volume( ) const { return l* h* w; }
bool operator > ( const box& a) const { return volume( ) > a.volume ( ) ; }
friend ostream& operator<< ( ostream& os, const box& b) ;
private :
double h;
double l;
double w;
} ;
ostream& operator<< ( ostream& os, const box& b)
{
return os << b.h << " x " << b.l << " x " << b.w ;
}
int main( ) {
//Question #2
box x( 1 , 2 , 3 ) , g;
box f( 7 , 8 , 120 ) , m( 8 , 6 , 4 ) ;
cout << "Comparing g (" << g << ") and x (" << x << ")\n " ;
cout << " g (" << g.volume ( ) << ") " ;
if ( g > x)
cout << "is greater " ;
else
cout << "is not greater " ;
cout << "than x (" << x.volume ( ) << ")\n " ;
cout << "\n Comparing m (" << m << ") and f (" << f << ")\n " ;
cout << "m (" << m.volume ( ) << ") " ;
if ( m > f)
cout << "is greater " ;
else
cout << "is not greater " ;
cout << "than f (" << f.volume ( ) << ")\n " ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgYm94ewoKcHVibGljOgogICAgYm94KGludCBhID0gMCwgaW50IGIgPSAwLCBpbnQgYyA9IDApIDogaChhKSwgbChiKSwgdyhjKSB7fQoKICAgIGRvdWJsZSB2b2x1bWUoKSBjb25zdCB7IHJldHVybiBsKmgqdzsgfQoKICAgIGJvb2wgb3BlcmF0b3IgPiAoY29uc3QgYm94JiBhKSBjb25zdCB7IHJldHVybiB2b2x1bWUoKSA+IGEudm9sdW1lKCk7IH0KCiAgICBmcmllbmQgb3N0cmVhbSYgb3BlcmF0b3I8PChvc3RyZWFtJm9zLCBjb25zdCBib3gmIGIpOwoKcHJpdmF0ZToKICAgIGRvdWJsZSBoOwogICAgZG91YmxlIGw7CiAgICBkb3VibGUgdzsKCn07Cgpvc3RyZWFtJiBvcGVyYXRvcjw8KG9zdHJlYW0mIG9zLCBjb25zdCBib3gmIGIpCnsKICAgIHJ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