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

📄 room.cc

📁 做为SD0609的一员,我扎实的基础是如何打出来的,来看看我那时连猴子选大王都不会的人,是如何成长起来的吧!主要包括我所做的C++,JAVA基础联系.乱是乱了点,不过如果真心想学习,打好基础,看看也不
💻 CC
字号:
#include <iostream>#include <string>using namespace std;class Room{	int length;	int width;	int height;	int No;public:	Room(){}	Room( int l, int w, int h, int n )	:length(l),width(w),height(h),No(n)	{}	int getLength()const	{		return length;	}	void setLength( int l )	{		length = l;	}	int getWidth()const	{		return width;	}	void setWidth( int w )	{		width = w;	}	int getHeight()const	{		return height;	}	void setHeight( int h )	{		height = h;	}	int getNo()const	{		return No;	}	void setNo( int n )	{		No = n;	}	void show()const	{		cout << "length:" << length << endl;		cout << "width:" << width << endl;		cout << "height:" << height << endl;		cout << "No:" << No << endl;	}};class ClassRoom : public Room{	int sites;	string Class;public:	ClassRoom(){}	ClassRoom( int l, int w, int h, int n, int s, string c )	:Room(l,w,h,n),sites(s),Class(c)	{}	int getSites()const	{		return sites;	}	void setSites( int s )	{		sites = s;	}	string getClass()const	{		return Class;	}	void setClass( string c )	{		Class = c;	}	void show()const	{		Room::show();		cout << "sites:" << sites << endl;		cout << "class:" << Class << endl;	}};int main(int argc, char* argv[]){	ClassRoom oc(10,5,3,209,50,"Tarena01");	oc.show();	char buf[100];	cout << "press Enter to continue...";	cin.getline( buf, 100 );	ClassRoom cr;	cr.setLength(12);	cr.setWidth(6);	cr.setHeight(2);	cr.setNo(210);	cr.setSites(60);	cr.setClass("Tarena02");	cr.show();	return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -