⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 01fruit.cpp

📁 一、教学目的: 能理解C++中运算符重载的需要性
💻 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 + -