类 Book 的代码可以如下所示:
class Book
{
public:
// 构造函数
Book(string name, string author, string publisher);
// 析构函数
~Book();
// 复制构造函数
Book(const Book& other);
// 虚函数,用于输出图书信息
virtual void print() const;
private:
string m_name; // 书名
string m_author; // 作者
string m_publisher; // 出版社
};