#include <iostream>
using namespace std;
class Animal
{
public:
Animal() {}
virtual ~Animal() {}
virtual void perform() = 0;
};
class Human : public Animal
{
public:
Human() {}
void perform();
virtual ~Human() {}
};
class Lion : public Animal
{
public:
Lion() {}
void perform();
virtual ~Lion() {}
};
void Human :: perform()
{
cout << "人喷火" << endl;
}
void Lion :: perform()
{
cout << "狮子钻火圈" << endl;
}
template <typename T>
void exchange(T &a,T &b)
{
T temp;
temp = a;
a = b;
b = temp;
}
int main()
{
int a = 10,b = 11;
float c = 1.2,d = 8.2;
exchange(a,b);
exchange(c,d);
cout << a << "\t" << b << endl;
cout << c << "\t" << d << endl;
return 0;
}