策略模式

#include <iostream>   using namespace std;   class StrategyInterface {     public:         virtual void execute() = 0; };   class ConcreteStrategyA: public StrategyInterface {     public:         virtual void execute()         {             cout << "Called ConcreteStrategyA execute…