day 6

#include 

using namespace std;
class Animal
{
public:
    virtual void perform()=0;
};
template  
class Action : public Animal
{
    Y a;
    L b;
public:
    Action(){}
    Action(Y a,L b):a(a),b(b){}
    void perform()
    {
        cout << a << "正在" << b < s1("猴子","唱歌");
    p1 = &s1;
    p1 -> perform();
    Action  s2("老虎","咆哮");
    p2 = &s2;
    p2 -> perform();
    Action  s3("熊猫","吃竹子");
    p3 = &s3;
    p3 ->perform();
    return 0;
}

你可能感兴趣的:(c++,算法,开发语言)