用Factory设计模式解决一个网友的问题

“ 定义一个如下所示的CNumber类,并以其为基类派生出素数类CPrimeNumber,完全平方数类CCompleteSquareNumber和回文数类CPalindromeNumber。 class CNumber { protected: char *p_type; // points to the text stating type of the number public: CNumbe
相关文章
相关标签/搜索