第十二周專案 閱讀程式 c

2021-07-11 19:42:37 字數 506 閱讀 5290

/*

*檔名稱:main.cpp

*作 者:李德坤

*完成日期:2023年5月14日

*版本號:v1.0

* *問題描述:閱讀程式,輸出結果

*輸入描述:無

*輸出描述:無

*/#includeusing namespace std;

class wages//「工資」類

double getpay()const;//返回應付工資額

wages operator+(wages w)const;//過載加法

};double wages::getpay()const

wages wages::operator+(wages w)const

int main()

//輸出結果為8100

第十二周 閱讀程式

檔名稱 test.cpp 作 者 呼亞萍 完成日期 2015年5月27日 版 本 號 v1.0 問題描述 閱讀程式,寫出執行結果 程式輸入 相應的程式 程式輸出 對應得結果 include using namespace std class a a int i void print class b ...

第十二周閱讀程式(5)

a include using namespace std class a void printa void printa void printa void printa 將會發生錯誤的一行刪除 p printb 對餘下的程式,你認為輸出是 a 1 b 1 a 2 b 3 實際執行的輸出是 那一行的...

第十二周 專案一 閱讀程式(4)

問題及 檔名稱 project4.cpp 作 者 李楠 完成日期 2014年11月13日 版 本 號 v1.0 問題描述 理解函式的預設引數 輸入描述 略 程式輸出 略 include using namespace std const double pi 3.1415926 float area ...