?? ch17_1.cpp
字號:
//**********************
//** ch17_1.cpp **
//**********************
#include<iostream.h>
class Bed{
public:
Bed() :weight(0){}
void Sleep(){ cout <<"Sleeping...\n"; }
void SetWeight(int i){ weight =i; }
protected:
int weight;
};
class Sofa{
public:
Sofa() :weight(0){}
void WatchTV(){ cout <<"Watching TV.\n"; }
void SetWeight(int i){ weight =i; }
protected:
int weight;
};
class SleeperSofa :public Bed, public Sofa{
public:
SleeperSofa(){}
void FoldOut(){ cout <<"Fold out the sofa.\n"; }
};
void main()
{
SleeperSofa ss;
ss.WatchTV();
ss.FoldOut();
ss.Sleep();
cin.get();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -