#include <iostream>
using namespace std;
目前分類:C++ (34)
- Jun 06 Wed 2018 11:33
C++ 自刻Insertion Sort
- Jun 06 Wed 2018 11:32
C++ 自刻stack
#include <iostream>
using namespace std;
- Jun 06 Wed 2018 09:26
C++ 實作自製雙向鏈結串鏈+template開放資料型態
#include <iostream>
using namespace std;
- May 30 Wed 2018 11:36
C++ 隨堂測驗Linklist
- May 30 Wed 2018 11:22
C++ 自製Linklist-以main來insert, remove
#include <iostream>
using namespace std;
- May 16 Wed 2018 11:38
C++ 多形
- May 16 Wed 2018 11:24
C++ 多重繼承
child類別,同時繼承father類別及mother類別。
注意若father及mother都有相同名稱的data或function,要在child類別使用name space來指定繼承。否則會發生name conflict。
- May 16 Wed 2018 10:06
C++ Composition+Inheritance實作-以car為例
- May 10 Thu 2018 08:31
C++ (小技巧複習)陣列傳遞-以找最大最小值為例
#include <iostream>
#include <limits.h> /*這個檔案可以設定型別的最大數值及最小數值*/
- May 10 Thu 2018 08:19
C++ class 使用 static
- May 09 Wed 2018 22:24
C++ 亂數
- May 09 Wed 2018 21:56
C++ Operator overloading運算子自訂義
以複數相加相乘為例,input兩個複數,output運算結果
Operator overloading,兩個方法:1、friend function 2、member function
- May 09 Wed 2018 11:41
C++ 繼承02-Redefine
- Apr 18 Wed 2018 22:19
C++ destructor解構子、解構順序
- Apr 18 Wed 2018 22:13
C++ Friend function
- Apr 18 Wed 2018 22:08
C++ Composition
Composition就是指可以在classA當中實作classB的物件,其實就是function互相呼叫的class版本,也蠻像自動堆疊的遞迴函數。
以此目的達到:(->表示呼叫)
- Apr 18 Wed 2018 21:34
C++ 實作烏鴉喝水題
敘述:烏鴉要啄石子放入有水的玻璃瓶,這隻烏鴉的數理不錯,利用排容原理取出水喝。
條件:輸入多筆測資代表石子的半徑,石子半徑要<瓶口半徑(3.5)才能放入瓶中,請用break、continue判斷。
- Apr 18 Wed 2018 21:22
C++ 進階蝸牛,以try-throw-catch實作
題目敘述:又是這隻小小蝸牛,看到大樹就充滿決心想往上爬,位置在0開始,大樹高度100。
蝸牛天亮就爬5、天黑就會睡覺且會滑落2,但是蝸牛爬到的位置若有樹幹就可以在樹幹上睡覺不滑落。
- Apr 18 Wed 2018 21:07
C++ 物件導向實作ATM提款機