freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

第六章數(shù)據(jù)抽象-類-文庫吧

2025-07-05 23:59 本頁面


【正文】 month = m。 day = d。 } bool is_leap_year() { return (year%4 == 0 amp。amp。 year%100 != 0) || (year%400==0)。 } void print() { coutyear.month.dayendl。 } private: int year,month,day。 }。 8 Date類(成員函數(shù)外部定義) class Date { public: void set(int y, int m, int d)。 bool is_leap_year()。 void print()。 private: int year,month,day。 }。 void Date::set(int y, int m, int d) { year = y。 month = m。 day = d。 } bool Date::is_leap_year() { return (year%4 == 0 amp。amp。 year%100 != 0) || (year%400==0)。 } void Date::print() { coutyear.month.dayendl。 } 9 TPoint類 class TPoint { public: void SetPoint(int x, int y)。 int Xcoord() { return X 。 } int Ycoord() { return Y 。} void Move(int xOffset, int yOffset) 。 private: int X, Y。 }。 void TPoint::SetPoint(int x, int y) { X=x 。 Y=y 。 } void Tpoint::Move(int xOffset, int yOffset) { X+=xOffset。 Y+=yOffset。 } 10 對象的操作 class A { public: int x。 void f() { 允許訪問: x,y,z,f,g,h } private: int y。 void g() { 允許訪問: x,y,z,f,g,h } protected: int z。 void h() { 允許訪問: x,y,z,f,g,h } }。 ...... A a。 = 1。 //OK ()。 //OK = 1。 //Error ()。 //Error = 1。 //Error ()。 //Error 11 對 Date類的對象訪問 include iostream using namespace std。 include “” int main() { int y, m, d。 cout“請輸入年、月、日 :“。 cinymd。 Date some_date。 //創(chuàng)建一個 Date類的對象 d (y,m,d)。 //設(shè)置對象 d的日期值 ()。 //輸出 d所表示的日期 if(()) cout“是閏年 \n”。 else cout“不是閏年 \n”。 return 0。 }。 12 對象的操作 class A { public: int x。 void f() { 允許訪問: x,y,z,f,g,h } private: i
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1