PROGRAMMING:Ma huifei
It is known that horse class is the parent class of Pegasus class. According to the following main functions, improve the program content to achieve the specified output. It is not allowed to change the content of the main function.
```
int main()
{
Horse *p1 = new Horse; // Output: Horse applied for space
Horse *p2 = new Pegasus; /* Output two lines:
Horse applied for space
Pegasus applied for space
*/
cout << endl;
p1->Fly(); // Output: just a horse
p2->Fly(); // Output: I can fly!
cout << endl;
delete p1; // Output: Horse frees up space
delete p2; /* Output two lines:
Pegasus frees up space
Horse frees up space
*/
return 0;
}
```
###Input format:
nothing
###Output format:
Output according to the sample format.
###Input example:
Here is a set of inputs. For example:
```in
nothing
```
###Output example:
The corresponding output is given here. For example:
```out
Horse applied for space
Horse applied for space
Pegasus applied for space
Just a horse.
I can fly!
Horse frees up space
Pegasus frees up space
Horse frees up space
```
answer:If there is no answer, please comment
```
int main()
{
Horse *p1 = new Horse; // Output: Horse applied for space
Horse *p2 = new Pegasus; /* Output two lines:
Horse applied for space
Pegasus applied for space
*/
cout << endl;
p1->Fly(); // Output: just a horse
p2->Fly(); // Output: I can fly!
cout << endl;
delete p1; // Output: Horse frees up space
delete p2; /* Output two lines:
Pegasus frees up space
Horse frees up space
*/
return 0;
}
```
###Input format:
nothing
###Output format:
Output according to the sample format.
###Input example:
Here is a set of inputs. For example:
```in
nothing
```
###Output example:
The corresponding output is given here. For example:
```out
Horse applied for space
Horse applied for space
Pegasus applied for space
Just a horse.
I can fly!
Horse frees up space
Pegasus frees up space
Horse frees up space
```
answer:If there is no answer, please comment