第十五周實踐專案1 4 閱讀程式,體會STL用法

2021-07-13 05:31:43 字數 673 閱讀 1302

問題及**:

/*

*all right reserved.

*檔名稱:77.cpp

*作 者:董凱琦

*完成日期:2023年6月7日

*版 本 號:v1.0

* *問題描述:

閱讀程式,體會stl用法

*輸入描述:

*程式輸出:

*/#include #include #include #include #include using namespace std;

class myadd: public binary_function

};int main()

; vectormy(5);

transform(a,a+5,my.begin(), bind2nd(myadd(), 4));

copy(my.begin(), my.end(), ostream_iterator(cout, " "));

cout

cout執行結果:

程式分析:

1、依次將各數字加上4 ,並輸出結果

2、加上自己本身,輸出結果

第十五周專案 閱讀程式2

all right reserved.檔名稱 test.cpp 完成日期 2016年6月21日 版本號 v1.0 問題描述 閱讀程式 程式輸入 程式輸出 include include include using namespace std class cstudent cstudent int n...

第十五周 閱讀程式(1)

檔名稱 test.cpp 作 者 呼亞萍 完成日期 2015年6月15日 版 本 號 v1.0 程式輸入 相應的程式 程式輸出 對應得結果 include include include using namespace std int main int a ofstream outfile f1.d...

第十五周 閱讀程式(2)

檔名稱 test.cpp 作 者 呼亞萍 完成日期 2015年6月15日 版 本 號 v1.0 問題描述 檢視下面程式的輸出,解釋為什麼會有這樣的輸出。程式輸入 相應的程式 程式輸出 對應得結果 include include using namespace std int main ofstrea...