c++ prime, 继承与多态