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

正文內(nèi)容

軟件技術基礎棧和隊列上機報告-在線瀏覽

2025-07-19 00:33本頁面
  

【正文】 free(p)。 return(x)。 int le。 node_type *p。 return。 le=slength。 printf(%d ,s1topdata)。 }while(i)//返回原棧 push(s,pop(s1))。 stack_type stack。 =0。num)amp。num!=0) push(amp。 printf(The length of the stack is:\n%d,)。 showstack(amp。 printf(\nThe length of the stack is:\n%d\n,)。 printf(%d\n,pop(amp。 printf(The second number to pop\n)。stack))。 return 0。 int front, rear。2)編寫循環(huán)隊列出隊函數(shù)dequeue3)編寫循環(huán)隊列入隊函數(shù)enqueue4)編寫函數(shù):void aa(queue_type *q); 調(diào)用出對函數(shù)把隊列q中的元素一一出對列,如果是負數(shù)直接拋棄;如果是正數(shù),則調(diào)用入隊函數(shù),插入到q的隊尾。 二、程序代碼includeincludeincludedefine N 20//定義循環(huán)隊列typedef struct{ int data[N]。}queue_type。 if(qrear==qfront) printf(the queue is NULL!)。 qfront=(qfront+1)%N。}//入隊函數(shù)void enqueue(queue_type *q,int newnum){ if((qrear+1)%N==qfront) printf(the queue is FULL!)。 qrear=(qrear+1)%N。 for(i=qfront。i=(i+1)%N) printf(%d ,qdata[i])。}//把隊列q中的元素一一出對列,如果是負數(shù)直接拋棄;如果是正數(shù),則調(diào)用入隊函數(shù),插入到q的隊尾void aa(queue_type *q){ int x。 t=qrearqfront+1。 while(t){ x=dequeue(q)。 }}int main(){ queue_type que。 =0。 while(scanf(%d,amp。 ++。que)。que)。que)。(qrear+1)%N!=qfront。i!=(qrear+1)。 =0。x)!=EOF){ []=x。}3)問題:輸出時只有第一個元素按照aa函數(shù)的要求進行了處理原因:aa函數(shù)中沒有循環(huán)解決辦法:再定義一個變量t,使算法循環(huán)ex3_3:一、程序流程說明書上第12題:創(chuàng)建兩個棧公用一個以為數(shù)組空間S[m],他們的棧底分別設在一維數(shù)組的兩端。二、程序代碼includeincludedefine m 100
點擊復制文檔內(nèi)容
公司管理相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1