将fileencoding改为utf-8
parent
72a37f177a
commit
ea3ffad916
|
@ -5,20 +5,22 @@
|
|||
#include <string.h>
|
||||
using namespace std;
|
||||
|
||||
//抽象产品类AbstractProduct
|
||||
//抽象产品类AbstractProduct
|
||||
class AbstractSportProduct
|
||||
{
|
||||
public:
|
||||
AbstractSportProduct(){
|
||||
|
||||
}
|
||||
virtual ~AbstractSportProduct(){}
|
||||
//抽象方法:
|
||||
virtual void printName(){};
|
||||
virtual void play(){};
|
||||
virtual ~AbstractSportProduct(){};
|
||||
//抽象方法:
|
||||
// virtual void printName(){};
|
||||
virtual void printName() = 0;
|
||||
// virtual void play(){};
|
||||
virtual void play() = 0;
|
||||
};
|
||||
|
||||
//具体产品类Basketball
|
||||
//具体产品类Basketball
|
||||
class Basketball :public AbstractSportProduct
|
||||
{
|
||||
public:
|
||||
|
@ -30,7 +32,7 @@ public:
|
|||
{
|
||||
|
||||
}
|
||||
//具体实现方法
|
||||
//具体实现方法
|
||||
void printName(){
|
||||
printf("Jungle get Basketball\n");
|
||||
}
|
||||
|
@ -39,7 +41,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
//具体产品类Football
|
||||
//具体产品类Football
|
||||
class Football :public AbstractSportProduct
|
||||
{
|
||||
public:
|
||||
|
@ -51,7 +53,7 @@ public:
|
|||
{
|
||||
|
||||
}
|
||||
//具体实现方法
|
||||
//具体实现方法
|
||||
void printName(){
|
||||
printf("Jungle get Football\n");
|
||||
}
|
||||
|
@ -60,7 +62,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
//具体产品类Volleyball
|
||||
//具体产品类Volleyball
|
||||
class Volleyball :public AbstractSportProduct
|
||||
{
|
||||
public:
|
||||
|
@ -72,7 +74,7 @@ public:
|
|||
{
|
||||
|
||||
}
|
||||
//具体实现方法
|
||||
//具体实现方法
|
||||
void printName(){
|
||||
printf("Jungle get Volleyball\n");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue