#include <iostream>
#include <string>
using namespace std;
class Customer
{
public:
string name;
int age;
Customer(string n,int a)
{
name=n;
age=a;
}
};
class Zhongjie
{
protected:
string name;
public:
Zhongjie(string n){name=n;}
virtual void findlove(Customer* customer)=0;
};
class HunJie:public Zhongjie
{
public:
HunJie(string name):Zhongjie(name){}
void findlove(Customer* customer)
{
if(customer->age<18)
{
cout <<name<<":"<<customer->name<<",对不起!不能早恋!" << endl;
}
else if(customer->age<100)
{
cout <<name<<":"<<customer->name<<",我们将全力为您找到匹配的另一半!" << endl;
}
else
{
cout <<name<<":"<<customer->name<<",对不起!您年龄太大了!" << endl;
}
}
};
int main()
{
Zhongjie* hunJie1,* hunJie2;
hunJie1=new HunJie("百合介绍所");
hunJie2=new HunJie("玫瑰介绍所");
Customer* b1=new Customer("小明",29);
Customer* b2=new Customer("小明",16);
hunJie1->findlove(b1);
hunJie2->findlove(b2);
return 0;
}