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

正文內(nèi)容

c語(yǔ)言課后習(xí)題答案-資料下載頁(yè)

2025-06-28 08:13本頁(yè)面
  

【正文】 t age? /* 年齡 */ char telephone[13]? /* 聯(lián)系電話 */ }? int Count = 0? /* 定義全局變量 Count,記錄當(dāng)前聯(lián)系人總數(shù) */ void new_friend(struct friends_list friends[ ] )? void search_friend(struct friends_list friends[ ], char *name)? int main(void) { int choice? char name[10]? struct friends_list friends[50]? /* 包含 50 個(gè)人的通訊錄 */ do{ printf(手機(jī)通訊錄功能選項(xiàng):1:新建 2:查詢 0:退出\n)? printf(請(qǐng)選擇功能:)? scanf(%d, amp。choice)? switch(choice){ case 1: new_friend(friends)? break? case 2: printf(請(qǐng)輸入要查找的聯(lián)系人名:)? scanf(%s, name)? search_friend(friends, name)? break? case 0: break? } }while(choice != 0)? printf(謝謝使用通訊錄功能!\n)? return 0? } /*新建聯(lián)系人*/ void new_friend(struct friends_list friends[ ]) { struct friends_list f? if(Count 50){ printf(通訊錄已滿!\n)? return? } printf(請(qǐng)輸入新聯(lián)系人的姓名:)? scanf(%s, )? printf(請(qǐng)輸入新聯(lián)系人的年齡:)? scanf(%d, amp。)? printf(請(qǐng)輸入新聯(lián)系人的聯(lián)系電話:)? scanf(%s, )? friends[Count] = f? Count++? } /*查詢聯(lián)系人*/ void search_friend(struct friends_list friends[ ], char *name) { int i, flag = 0? if(Count 0){ printf(通訊錄是空的!\n)? return? } for(i = 0? i Count? i++) if(strcmp(name,friends[i].name) 0){ /* 找到聯(lián)系人*/ flag=1? break? } if(flag){ printf(姓名: %s\t, friends[i].name)? printf(年齡: %d\t, friends[i].age)? printf(電話: %s\n, friends[i].telephone)? } else printf(無(wú)此聯(lián)系人!)? } 4. 建立一個(gè)教師鏈表,每個(gè)結(jié)點(diǎn)包括學(xué)號(hào)(no),姓名(name[8]),工資(wage),寫出動(dòng)態(tài)創(chuàng)建 函數(shù) creat 和輸出函數(shù) print。 include include define NULL 0 define LEN sizeof(struct teacher) struct teacher {int no? char name[8]? float wage? struct teacher * next? }? int n? struct teacher *creat(void) { struct teacher *head? struct teacher *p1,*p2? n=0? p1=p2= (struct teacher *)malloc(LEN)? scanf(“%d%s%f”,amp。p1?no,p1?name, amp。p1?wage)? head=NULL? while(p1?no!=0) { n=n+1? if(n 1) head p1? else p2?next p1? p2=p1? p1=( struct teacher *)malloc(LEN)? scanf(“%d%s%f”,amp。p1?no,p1?name, amp。p1?wage)? } p2?next=NULL? return(head)? } void print(struct teacher *head) { struct teacher *p? p=head? if (head!=NULL) do{ printf(“%d\t%s\t%f\n”, p?no, p?name, p?wage)? p=p?next? } while(p!=NULL)? } ,假如已經(jīng)按學(xué)號(hào)升序排列,寫出插入一個(gè)新教師的結(jié)點(diǎn)的函數(shù) insert。 struct teacher insert(struct teacher *head,struct teacher *tea) { struct teacher *p0,*p1,*p2? p1=head? p0=tea? if(head=NULL) {head=p0? p0?next=NULL?} else while((p0?nop1?no)amp。amp。(p1?next!=NULL)) { p2=p1? p1=p1?next?} if(p0?no p1?no) { if (head p1) head=p0? else { p2?next p0? p0?next p1? } else { p1?next p0?p0?next=NULL?} n=n+1? return(head)? }
點(diǎn)擊復(fù)制文檔內(nèi)容
高考資料相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1