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

正文內(nèi)容

軟件技術(shù)基礎(chǔ)棧和隊列上機報告-資料下載頁

2025-06-01 00:33本頁面
  

【正文】 pe。//出隊函數(shù)int dequeue(queue_type *q){ int out。 if(qrear ==q frontamp。amp。tag==0) printf(the queue is NULL!)。 else { out = qdata[qfront]。 qfront=(qfront+1)%N。 } return(out)。}//入隊函數(shù)void enqueue(queue_type *q,int newnum){ if(qrear%N==qfrontamp。amp。tag==1) printf(the queue is FULL!)。 else { qdata[qrear]=newnum。 qrear=(qrear+1)%N。 if(qrearqfront)tag=0。 }}//輸出void showqueue(queue_type *q){ int i。 for(i=qfront。 i!=qrear。 i=(i+1)%N) printf(%d ,qdata[i])。 printf(\n)。}int main(){ queue_type q。 int tag=0,data。 =0。 =0。 printf(enter the elements of the queue:\n)。 while(scanf(%d,amp。data)amp。amp。(data!=0)) enqueue(amp。q,data)。 printf(the queue is:\n)。 showqueue(amp。q)。 printf(the queue is:\n)。 showqueue(amp。q)。 printf(deque:\n%d\n,dequeue(amp。q))。 return 0。}三、輸入與輸出enter the elements of the queue:1 2 3 4 5 0the queue is:1 2 3 4 5the queue is:1 2 3 4 5deque:1請按任意鍵繼續(xù). . .四、上機遇到的問題1)問題:[Error] C:\Users\Administrator\Desktop\大二學(xué)習(xí)\軟基上機\:27: error: too few arguments to function `void enqueue(queue_type*, int)39。原因:主函數(shù)調(diào)用enqueue時沒有給予足夠的參數(shù),寫成了enqueue(amp。q)。解決辦法:將該行更改為 enqueue(amp。q,data)??偨Y(jié) 有了上一次編寫鏈表題的經(jīng)驗以后,這次上機要順利許多。但是仍然出現(xiàn)了許多錯誤,并且很多時候不能迅速地把自己的想法用程序語言表達(dá)出來。所以以后要加強有關(guān)方面的練習(xí)。這次的四道題目,充分地體現(xiàn)了順序存儲和鏈?zhǔn)酱鎯Φ穆?lián)系與區(qū)別。編寫的時候,雖然覺得順序存儲比較容易寫,但是鏈?zhǔn)酱鎯τ诳臻g的節(jié)省讓我更加充分地充分感受到了計算機的魅力。
點擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1