【单选题】如有如下点类,则正方形类的成员函数定义正确的是() class Point { int x, y; public: Point(int x, int y):x(x), y(y){}; void print(){cout< }; class Square { double len; Point p; public: Square(double, int, int); void print()cons...
A.
Square::Square(double l, int xx, int yy) { len = l>0? l:0; p.x =xx; p.y = yy; }
B.
void Square::print()const { cout < cout< }
C.
void Square::print()const { cout < p.print(); }
D.
Square::Square(double l, int xx, int yy):p(xx, yy) { len = l>0? l:0; }