23 lines
423 B
C++
23 lines
423 B
C++
|
#include <iostream>
|
|||
|
#include "FactoryMethod.h"
|
|||
|
|
|||
|
int main()
|
|||
|
{
|
|||
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ\n");
|
|||
|
|
|||
|
//<2F><><EFBFBD>幤<EFBFBD><E5B9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
AbstractFactory *fac = NULL;
|
|||
|
AbstractSportProduct *product = NULL;
|
|||
|
|
|||
|
fac = new BasketballFactory();
|
|||
|
product = fac->getSportProduct();
|
|||
|
|
|||
|
fac = new FootballFactory();
|
|||
|
product = fac->getSportProduct();
|
|||
|
|
|||
|
fac = new VolleyballFactory();
|
|||
|
product = fac->getSportProduct();
|
|||
|
|
|||
|
system("pause");
|
|||
|
return 0;
|
|||
|
}
|