c++多态问题

2024-12-17 01:16:26
推荐回答(2个)
回答1:

class Member{
public:
virtual void sports(){cout<<"Sports!";}
};
class Father: public Member{
public:

virtual void sports(){cout<<" Badminton!";}
};
class Mother: public Member{
public:
virtual void sports(){cout<<"Aerobics!";}
};
class Children: public Member{
public:
virtual void sports(){cout<<"Doing skipping!";}
};

回答2:

母亲的体育锻炼项目为跳健美操,