freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

面向?qū)ο蟪绦蛟O(shè)計課程期末復(fù)習提要(編輯修改稿)

2025-07-04 22:57 本頁面
 

【文章內(nèi)容簡介】 PrintAA()。 void PrintAA(char *)。 bool IsEmpty() {return len==0。} bool IsFull() {return len==MaxLen。} int GetLen() {return len。} int GetMaxLen() {return MaxLen。} int operator [](int i) {return a[i]。} int GetSum(int i)。 }。 /******************************************/ include include include bool AA::Insert(int data) { if (len==MaxLen) { coutoverflow!endl。 return false。 } a[len]=data。 len++。 return true。 } int AA::Delete(intamp。 index) { if (len==0) { cout No,Can39。t be deleted! endl。 return 0。 } index=a[0]。 for(int i=1。 ilen。 i++) a[i1]=a[i]。 len。 return 1。 } void AA::PrintAA() { for(int i=0。 ilen。 i++) couta[i] 。 coutendl。 } void AA::PrintAA(char *str) { for(int i=0。 ilen。 i++) couta[i] 。 coutstrlen=lenendl。 } int AA::GetSum(int i) { if(ilen) { coutError!endl。 exit(1)。 } int sum=0。 for(int j=0。 ji。 j++) sum+=a[j]。 return sum。 } /************************ *****************/ include include include void main() { AA x。 AA y(16)。 if (()amp。amp。 ()) coutLists are empty when initialized!endl。 else return。 int i,k。 for(i=0。 i()。 i++) (3*i)。 for(i=0。 i()。 i++) (5*i1)。 if (() amp。amp。 ()) coutLists are full!endl。 else coutLists are not full!endl。 for(i=0。 i(())/2。 i++) (k)。 (List_x )。 (List_y )。 for(i=0。 i(())/2。 i++) (x[i])。 ()。 cout(5)39。 39。(5)endl。 }寫出執(zhí)行此程序所顯示的結(jié)果:答案:Lists are empty when initialized!Lists are full!0 3 6 9 12 15 18 21 24 27 List_x len=1039 44 49 54 59 64 69 74 List_y len=839 44 49 54 59 64 69 74 0 3 6 9 12 15 18 2130 245程序3: 。在這個文件中首先定義了一個隊列元素類模板QueueItem,然后在這個類的基礎(chǔ)上定義了隊列類模板Queue。在Queue中使用鏈表存放隊列的各個元素,front指針指向鏈表的第一個節(jié)點元素,back指針指向鏈表的最后一個節(jié)點元素,成員函數(shù)add()將一個新節(jié)點元素加入到隊列結(jié)尾,remove()從隊列開頭刪除一個節(jié)點元素。為方便起見,程序中加上了行號。閱讀程序,根據(jù)程序后面的問題作出相應(yīng)解答。/*//********************* ***********************//*/1 template class Type2 class Queue。3 /***************** 定義模板類QueueItem ************/4 templateclass Type 5 class QueueItem6 {7 public:8 QueueItem(const Type amp。 elem):item(elem) {}9 QueueItem() {}10 private:11 Type item。12 QueueItem * nextItem。13 friend class QueueType。14 }。15 /***************** 定義模板類Queue ************/16 template class Type17 class Queue {18 public:19 Queue():front( NULL), ____(A)_____ {}20 ~Queue()。21 Type remove()。22 void add(const Type amp。)。23
點擊復(fù)制文檔內(nèi)容
教學教案相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1