類與物件程式設計題3(C 程式設計第3周)

2021-07-08 20:05:20 字數 803 閱讀 1065

問題描述

下面程式的輸出結果是:

5,55,5

請填空:

#include 

using

namespace

std;

class base

};class big ;

int main()

輸入

輸出

5,55,5樣例輸入

樣例輸出

5,5

5,5

提示

1.所缺**具有如下形式:

big ________________

big ________________

2.提交作業時只提交補充的**

原始碼

#include 

using

namespace

std;

class base

//型別轉換建構函式

};class big

//型別轉換建構函式

big(const big& a):v(a.v),b(a.b.k) {}//拷貝建構函式

};int main()

STL程式設計題3(C 程式設計第9周)

描述 現有一整數集 允許有重複元素 初始為空。我們定義如下操作 add x 把x加入集合 del x 把集合中所有與x相等的元素刪除 ask x 對集合中元素x的情況詢問 對每種操作,我們要求進行如下輸出。add 輸出操作後集合中x的個數 del 輸出操作前集合中x的個數 ask 先輸出0或1表示x...

多型與虛函式程式設計題 3(C 程式設計第6周)

問題描述 下面的程式輸出結果是 a fun a do a fun c do 請填空 include using namespace std class a virtual void do class b public a class c public b void fun void call 在此處...

運算子過載程式設計題3(C 程式設計第4周)

寫乙個二維陣列類 array2,使得下面程式的輸出結果是 0,1,2,3,4,5,6,7,8,9,10,11,next 0,1,2,3,4,5,6,7,8,9,10,11,include include using namespace std 在此處補充你的 int main cout endl c...