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

正文內容

軟件技術基礎棧和隊列上機報告(已修改)

2025-06-13 00:33 本頁面
 

【正文】 12姓名:闞姍蕾 學號:2010012030037上機實驗三ex3_1:一、程序流程說明鏈棧 1)鏈棧結點類型定義為: typedef struct node { int data。 struct node *next。 }node_type。2)編寫進棧函數(shù)push3)編寫出棧函數(shù)pop4)編寫main函數(shù),首先建立一空鏈棧; 調用進棧函數(shù),將從鍵盤輸入的數(shù)據(jù)元素逐個進棧,輸入0結束;顯示進棧后的數(shù)據(jù)元素; 調用兩次出棧函數(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。//進棧函數(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)//出棧,存于另一個棧中 { 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
點擊復制文檔內容
公司管理相關推薦
文庫吧 www.dybbs8.com
公安備案圖鄂ICP備17016276號-1