面试题答案
一键面试class Rectangle {
public:
int width;
int height;
// 默认构造函数
Rectangle() : width(0), height(0) {}
// 带参数的构造函数
Rectangle(int w, int h) : width(w), height(h) {}
};
class Rectangle {
public:
int width;
int height;
// 默认构造函数
Rectangle() : width(0), height(0) {}
// 带参数的构造函数
Rectangle(int w, int h) : width(w), height(h) {}
};