📄 01fruit.cpp
字号:
#include<iostream.h>
class Fruit
{
public:
void Eat(){cout<<"Can be eaten.\n";};
void Taste(){cout<<"Taste is good.\n";};
};
class Apple:public Fruit
{
public:
void Shape(){cout<<"The shape is a circle.\n";};
void Color(){cout<<"Different kinds of color.\n";};
};
void main()
{
Fruit fruit1;
fruit1.Eat();
fruit1.Taste();
Apple apple1;
apple1.Eat();
apple1.Taste();
apple1.Shape();
apple1.Color();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -