20 lines
352 B
C++
20 lines
352 B
C++
|
#include <iostream>
|
|||
|
#include "SimpleFactory.h"
|
|||
|
|
|||
|
int main()
|
|||
|
{
|
|||
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ\n");
|
|||
|
|
|||
|
//<2F><><EFBFBD>幤<EFBFBD><E5B9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
Factory *fac = new Factory();
|
|||
|
AbstractSportProduct *product = NULL;
|
|||
|
|
|||
|
product = fac->getSportProduct("Basketball");
|
|||
|
|
|||
|
product = fac->getSportProduct("Football");
|
|||
|
|
|||
|
product = fac->getSportProduct("Volleyball");
|
|||
|
|
|||
|
system("pause");
|
|||
|
return 0;
|
|||
|
}
|