将 main 函数改为如下代码:int main(){ A * a = new A; a->setdata(); a->getdata(); B b; a->setdata(); a->getdata(); C c; D d; delete a; return 0;}