靜態資料成員的應用

2021-07-11 03:56:54 字數 693 閱讀 8155

/*

* 檔名稱:main.cpp

* 作 者:胡慶龍

* 完成日期:2023年4月8日

* 版 本 號:v1.0

* * 問題描述:利用時間類,練習靜態資料成員的使用。

*/#include#includeusing namespace std;

class time;

bool time::is_24=true;

bool time::from0=false;

time::time(int h,int m,int s)

void time::show_time()

else

else

k=0;

if(from0)

}void time::add_minutes(int n) //增加n分鐘

}void time::add_hours(int n) //增加n小時

void time::change24() //改變制式

void time::changefrom0() //改變前導

靜態成員的應用

include include using std cout using std cin using std endl class time void set time 設定時間 void show time 顯示時間 void add seconds int 增加秒 void add minute...

靜態成員應用

作 者 任子儀 完成日期 2014年4月5日 輸入描述 問題描述 程式輸出 問題分析 include includeusing namespace std class cpoint double distance cpoint p const 兩點之間的距離 一點是當前點,另一點為引數p void ...

靜態成員應用

程式的版權和版本宣告部分 檔名稱 作 者 王凱 完成日期 2014年 4 月 7 日 版本號 v1.0 輸入描述 無 問題描述 include using namespace std class time time time int h,int m,int s hour h minute m sec...