#include <iostream>
using namespace std;
class iReader
{ public:
virtual string getContents()=0;
virtual int playBall()=0;
};
class book:public iReader
{ public:
string getContents()
{return "ai du shu";}
int playBall(){}
};
class newPaper:public iReader
{ public:
string getContents()
{return "du bao zhi";}
int playBall(){}
};
class basketBall:public iReader
{public:
string getContents(){return "ABC";}
int playBall(){ return 3333;}
};
class mother
{public:
void tellStory(iReader *b)
{cout<<b->getContents() <<endl;
}
};
class father
{
public: void playBall(iReader *b)
{cout<<b->playBall() <<endl;}
};
int main()
{ //妈妈 爸爸 通过接口 读书 打球
book b;
newPaper nP;
mother mama;
mama.tellStory(&b);
mama.tellStory(&nP);
basketBall bB;
father fa;
fa.playBall(&bB);
//cout << "Hello World!" << endl;
return 0;
}