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

正文內(nèi)容

軟件技術(shù)基礎(chǔ)棧和隊(duì)列上機(jī)報(bào)告(已修改)

2025-06-13 00:33 本頁(yè)面
 

【正文】 12姓名:闞姍蕾 學(xué)號(hào):2010012030037上機(jī)實(shí)驗(yàn)三ex3_1:一、程序流程說(shuō)明鏈棧 1)鏈棧結(jié)點(diǎn)類型定義為: typedef struct node { int data。 struct node *next。 }node_type。2)編寫進(jìn)棧函數(shù)push3)編寫出棧函數(shù)pop4)編寫main函數(shù),首先建立一空鏈棧; 調(diào)用進(jìn)棧函數(shù),將從鍵盤輸入的數(shù)據(jù)元素逐個(gè)進(jìn)棧,輸入0結(jié)束;顯示進(jìn)棧后的數(shù)據(jù)元素; 調(diào)用兩次出棧函數(shù),顯示出棧后的數(shù)據(jù)元素。二、程序代碼includeinclude//定義鏈棧typedef struct node_type{ int data。 struct node_type *next。} node_type。typedef struct stack_type{ node_type *top。 int length。} stack_type。//進(jìn)棧函數(shù)void push(stack_type *s,int newnode){ node_type *p。 p=(node_type *)malloc(sizeof(node_type))。 pdata=newnode。 pnext=stop。 stop=p。 slength ++。}//出棧函數(shù)int pop(stack_type *s){ node_type *p。 int x。 if(stop==NULL) { printf(The stack is NULL!\n)。 return(0)。 } else { x=stopdata。 p=stop。 stop=stopnext。 free(p)。 slength。 return(x)。 }}//遍歷并輸出void showstack(stack_type *s){ int i=0。 int le。 stack_type *s1。 node_type *p。 if(slength=0) { printf(No data!\n)。 return。 } s1length=0。 le=slength。 while(ile)//出棧,存于另一個(gè)棧中 { push(s1,pop(s))。 printf(%d ,s1topdata)。 i++。 }while(i)//返回原棧 push(s,pop(s1))。}int main(){ int num。 stack_type stack。 printf(\ninsert:number :\n)。 =0。 while(scan
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
公安備案圖鄂ICP備17016276號(hào)-1