第九周任務報告一

2021-06-05 20:08:30 字數 1450 閱讀 1943

* 程式頭部注釋開始* 程式的版權和版本宣告部分

* 作 者: 時永傑

* 完成日期: 2012 年 4月 17日

* 版 本 號:v1.1

實現time類中的運算子過載

#include using namespace std;

class ctime

;

#include #include "t1.h"

using namespace std;

void main()

while (1);

return input;

}ostream &operator<

else

return false;

} else

return false;

}bool ctime::operator >= (ctime &t)

else

return false;

} else

return false;

}bool ctime::operator < (ctime &t)

else if(d.minute>=60)

else if(d.hour>=24)

hour=hour%24;

return d;

}*/ctime ctime::operator-(ctime &c)

ctime ctime::operator+(ctime &c)

ctime ctime::operator+(int s)

ctime ctime::operator-(int s)

ctime ctime::operator++()//前置++

return *this;

}ctime ctime::operator++(int)//後置++

return temp;

}ctime ctime::operator--()//前置--

else

second-=1;

return *this;

}ctime ctime::operator--(int)//後置--

using namespace std;不能丟

相信編譯器,錯誤編譯器不會出,人出。

第九周任務報告1

程式頭部注釋開始 程式的版權和版本宣告部分 作 者 時永傑 完成日期 2012 年 4月 21日 版 本 號 v1.1 include includeusing namespace std class point 定義座標點類 point double x0,double y0 void print...

第九周 任務一

實驗內容 定義complex類中的 和 運算子的過載,實現輸入和輸出。程式的版權和版本宣告部分 檔名稱 定義complex類中的 和 運算子的過載,實現輸入和輸出 作 者 薛廣晨 完成日期 2012 年 4 月 14日 版 本號 x1.0 對任務及求解方法的描述部分 輸入描述 程式頭部的注釋結束 此...

第九周 任務三

實驗內容 定義分數類中 和 運算子過載 程式的版權和版本宣告部分 檔名稱 定義分數類中 和 運算子過載 作 者 薛廣晨 完成日期 2012 年 4 月 14 日 版 本號 x1.0 任務3 接第8周任務3,定義分數類中 和 運算子過載,實現分數的輸入輸出,改造原程式中對運算結果顯示方式,使程式讀起來...