![《程序設(shè)計(jì)實(shí)踐》課程報(bào)告-_第1頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/4/4e13358f-25b8-4b25-ac04-81adfa14e1ab/4e13358f-25b8-4b25-ac04-81adfa14e1ab1.gif)
![《程序設(shè)計(jì)實(shí)踐》課程報(bào)告-_第2頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/4/4e13358f-25b8-4b25-ac04-81adfa14e1ab/4e13358f-25b8-4b25-ac04-81adfa14e1ab2.gif)
![《程序設(shè)計(jì)實(shí)踐》課程報(bào)告-_第3頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/4/4e13358f-25b8-4b25-ac04-81adfa14e1ab/4e13358f-25b8-4b25-ac04-81adfa14e1ab3.gif)
![《程序設(shè)計(jì)實(shí)踐》課程報(bào)告-_第4頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/4/4e13358f-25b8-4b25-ac04-81adfa14e1ab/4e13358f-25b8-4b25-ac04-81adfa14e1ab4.gif)
![《程序設(shè)計(jì)實(shí)踐》課程報(bào)告-_第5頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/4/4e13358f-25b8-4b25-ac04-81adfa14e1ab/4e13358f-25b8-4b25-ac04-81adfa14e1ab5.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、課 程 名 稱: 程序設(shè)計(jì)實(shí)踐 專 業(yè) 班 級(jí) : 學(xué) 生 姓 名 : 學(xué) 號(hào) : 任 課 教 師 : 學(xué) 期 : 課程報(bào)告任務(wù)書題 目通訊錄管理系統(tǒng)主要內(nèi)容開發(fā)一個(gè)模擬手機(jī)通訊錄管理軟件,聯(lián)系人信息主要包括:姓名、性別、電話號(hào)碼、總通信次數(shù)、QQ號(hào)碼、微信號(hào)碼、電子郵件、生日等信息。(也可以根據(jù)自己情況進(jìn)行擴(kuò)充),也可以進(jìn)一步地將聯(lián)系人劃分為所屬組名稱:比如同事,同學(xué),朋友,親人等)。通信次數(shù)(包括語音通話、短信、郵件等的通信的計(jì)次總次數(shù)),使之有基本功能:(1)聯(lián)系人信息錄入功能(數(shù)據(jù)信息用文件保存)v(2)聯(lián)系人信息的瀏覽功能(瀏覽的方式可以自行決定)(3)查詢功能(至少一種查詢方式)、
2、排序功能(至少一種排序方式): l 按姓名查詢 按號(hào)碼查詢 按照姓名排序 按年齡排序等或通信次排序 (4)聯(lián)系人信息的刪除與修改擴(kuò)展功能:比如(1)簡(jiǎn)單的權(quán)限處理 (2)報(bào)表打印功能(3)聯(lián)系人分組的功能,可以進(jìn)一步擴(kuò)充,比如新建分組、修改分組名稱,批量移動(dòng)信息人,如QQ分組功能。(4)查詢:比如按拼音首字符查詢或者按全拼查詢 (5)按照部分號(hào)碼查詢 (6)備份數(shù)據(jù)功能等;(7)根據(jù)聯(lián)系人信息中的總通信次數(shù)可以進(jìn)行排序,總之,可以根據(jù)自己需求進(jìn)行分析功能。任務(wù)要求一、提交材料應(yīng)包括:(1)系統(tǒng)源代碼 (2)課程報(bào)告二、整個(gè)設(shè)計(jì)過程具體要求(1)需求分析 要求學(xué)生對(duì)案例系統(tǒng)進(jìn)行分析,設(shè)計(jì)出需要完
3、成的功能,完善各個(gè)模塊的調(diào)用關(guān)系;(2)設(shè)計(jì)過程 要求學(xué)生進(jìn)一步明確各模塊調(diào)用關(guān)系,進(jìn)一步完善模塊函數(shù)細(xì)節(jié)(函數(shù)名、參數(shù)、返回值等)(3)實(shí)現(xiàn)過程 要求學(xué)生養(yǎng)成良好的編碼習(xí)慣、完成各個(gè)模塊并進(jìn)行測(cè)試,最終完成系統(tǒng)整體測(cè)試;(4)總結(jié)階段 按照要求完成系統(tǒng)設(shè)計(jì)和實(shí)現(xiàn)報(bào)告,并進(jìn)行總結(jié)、答辯。成績(jī)?cè)u(píng)定報(bào)告撰寫情況(30分)系統(tǒng)完成情況(30分)答辯情況(40分)總分內(nèi)容20分規(guī)范程度5分程序測(cè)試5分基本功能20分?jǐn)U展功能10分自述情況10分答辯情況30分成績(jī)?cè)u(píng)定教師: 1 需求分析1.1.開發(fā)一個(gè)一個(gè)手機(jī)通訊錄,用于記錄聯(lián)系人的姓名,年齡,性別,手機(jī)號(hào)碼,QQ號(hào)碼,家庭住址,以及電子郵件。1.2.滿
4、足用戶對(duì)通訊錄的基本操作:新建,刪除,修改,排序,查找,瀏覽,以及文件的讀與寫,掃描已有文件中的聯(lián)系人資料。新建:用戶可以添加多個(gè)聯(lián)系人。并進(jìn)行按照名字排序。刪除:滿足用戶按照名字對(duì)聯(lián)系人進(jìn)行刪除操作。修改:滿足用戶對(duì)聯(lián)系人的信息進(jìn)行修改。排序:實(shí)現(xiàn)聯(lián)系人按照名字和號(hào)碼進(jìn)行排序。查找:滿足用戶對(duì)聯(lián)系人進(jìn)行查找,對(duì)名字、號(hào)碼和QQ號(hào)碼進(jìn)行查找處理。瀏覽:輸出所有人的信息。文件的讀與寫:對(duì)聯(lián)系人的保存與讀。2 概要設(shè)計(jì)(小三黑體)2.1模塊概要2.1.1定義變量結(jié)構(gòu)體struct friends_list /儲(chǔ)存聯(lián)系人信息 char name20; /姓名 char age5; /年齡 char
5、sex3; /性別 char phonenumber15; /電話號(hào)碼 char QQnumber12; /QQ號(hào)碼 char address80; /地址 char num500; /編號(hào) char mail40; /電子郵箱 struct friends_list *next;2.1.2 自定義函數(shù)struct friends_list *load_friend(struct friends_list *head);/從文件中讀取聯(lián)系人void save_friend(struct friends_list *head);/保存聯(lián)系人struct friends_list *Create_
6、Lianxi_Doc(struct friends_list *head); /新建聯(lián)系人struct friends_list *Delete(struct friends_list *head,char *name); /刪除聯(lián)系人struct friends_list*xiugai(struct friends_list*head,char *name); /修改聯(lián)系人struct friends_list *sort_friend(struct friends_list *head,char *name);/排序void Print_friends_Doc(struct friends
7、_list *head); /查看所有聯(lián)系人void search_friend1(struct friends_list *head,char *name);/按姓名對(duì)聯(lián)系人進(jìn)行查找void search_friend2(struct friends_list *head,char *phonenum);/按電話號(hào)碼對(duì)聯(lián)系人進(jìn)行查找void search_friend3(struct friends_list *head,char *QQnumber); /按QQ號(hào)碼對(duì)聯(lián)系人進(jìn)行查找struct friends_list *scanf_friend();/掃描文件2.1.3 流程圖與模塊圖開
8、始輸入選項(xiàng)進(jìn)行操作新建聯(lián)系人導(dǎo)入已存聯(lián)系人信息是否保存聯(lián)系人信息修改信息刪除聯(lián)系人瀏覽聯(lián)系人排序查找聯(lián)系人按姓名查找按電話號(hào)碼查找按QQ號(hào)碼查找通訊錄管理系統(tǒng)新建讀取刪除修改瀏覽保存查找排序輸入聯(lián)系人信息文件中讀取聯(lián)系人輸入需刪除的聯(lián)系人姓名刪除聯(lián)系人所修改聯(lián)系人姓名修改內(nèi)容已建立的聯(lián)系人信息按姓名查找按電話查找按QQ號(hào)碼查找按姓名排序 圖1.12.1.4 自定義模塊2.1.4.1 新建聯(lián)系人 此模塊為聯(lián)系人的新建,用戶在提醒語句的提示下依次輸入新建聯(lián)系人的信息,并且在用戶輸入最后一條信息后回車結(jié)束新建,系統(tǒng)自動(dòng)返回主菜單參數(shù)為head,返回值為head。2.1.4.2 讀取文件中已有聯(lián)系人
9、此模塊主要用于用戶瀏覽已有聯(lián)系人的信息,參數(shù)為head,返回值為head。2.1.4.3 刪除聯(lián)系人 用戶通過輸入所要?jiǎng)h除的聯(lián)系人姓名進(jìn)行刪除操作,執(zhí)行此操作時(shí),用戶將刪除所輸入聯(lián)系人的所有信息,參數(shù)為head、name,返回值為head。2.1.4.4 修改聯(lián)系人 調(diào)用此模塊時(shí),用戶將首先輸入想要修改的聯(lián)系人姓名,之后將進(jìn)一步選擇所要修改的信息選項(xiàng),當(dāng)用戶將所有要修改的信息修改完成后可選擇0退出修改操作并返回主菜單;參數(shù)為head、name,返回值為head;2.1.4.5 瀏覽聯(lián)系人 對(duì)于已保存的聯(lián)系人信息(或文件中已存在的聯(lián)系人信息)可選擇此操作進(jìn)行遍歷操作,參數(shù)為head,無返回值;2
10、.1.4.6 保存 用戶在完成聯(lián)系人的新建后,可選擇此操作進(jìn)行保存處理,保存的聯(lián)系人信息將寫入文件中(若文件不為空擇將在文件中續(xù)寫),參數(shù)為head,無返回值;2.1.4.7 聯(lián)系人排序 此操作可將聯(lián)系人按照姓名進(jìn)行重新排序,參數(shù)為head、name,返回值為head;2.1.4.8 查找聯(lián)系人 在選擇此操作的時(shí)候,用戶將進(jìn)入查找方式的選擇界面,通過輸入序號(hào)進(jìn)行選擇查找方式,此操作共有三種搜索方式供用戶選擇1姓名2電話3QQ號(hào)碼,參數(shù)為head,無返回值。3 詳細(xì)設(shè)計(jì)# include<stdio.h># include<stdlib.h># include<st
11、ring.h>struct friends_list/儲(chǔ)存聯(lián)系人信息 char name20; /姓名 char age5; /年齡 char sex3; /性別 char phonenumber15;/電話號(hào)碼 char QQnumber12;/QQ號(hào)碼 char address80;/地址 char num500;/編號(hào) char mail40;/電子郵箱 struct friends_list *next;int Count=0;/全局變量 儲(chǔ)存聯(lián)系人個(gè)數(shù)int system(const char *string);struct friends_list *load_friend(
12、struct friends_list *head);/從文件中讀取聯(lián)系人void save_friend(struct friends_list *head);/保存聯(lián)系人struct friends_list *Create_Lianxi_Doc(struct friends_list *head); /新建聯(lián)系人struct friends_list *Delete(struct friends_list *head,char *name); /刪除聯(lián)系人struct friends_list*xiugai(struct friends_list*head,char *name); /修
13、改聯(lián)系人struct friends_list *sort_friend(struct friends_list *head,char *name);/排序void Print_friends_Doc(struct friends_list *head); /查看所有聯(lián)系人void search_friend1(struct friends_list *head,char *name);/按姓名對(duì)聯(lián)系人進(jìn)行查找void search_friend2(struct friends_list *head,char *phonenum);/按電話號(hào)碼對(duì)聯(lián)系人進(jìn)行查找void search_frien
14、d3(struct friends_list *head,char *QQnumber); /按QQ號(hào)碼對(duì)聯(lián)系人進(jìn)行查找struct friends_list *scanf_friend();=主函數(shù)=int main(void)/主函數(shù) struct friends_list *head; char choice; int choices; char name20; /*姓名*/ char phonenum15; char QQnumber13; head=NULL;head=scanf_friend(); do printf("ttt歡迎進(jìn)入通訊錄n"); printf
15、("tttt1.新建n"); printf("tttt2.讀取n"); printf("tttt3.刪除n"); printf("tttt4.修改n"); printf("tttt5.瀏覽n"); printf("tttt6.保存n"); printf("tttt7.排序n"); printf("tttt8.查找n"); printf("tttt0.退出n"); printf("tttn"); s
16、canf("%c",&choice); getchar(); while(choice<'0'|choice>'8')printf("n對(duì)不起,您輸入有誤!請(qǐng)重新輸入!n");scanf("%c",&choice);getchar(); switch(choice) case '1': head=Create_Lianxi_Doc(head);break; case '2': head=load_friend(head); break; cas
17、e '3': printf("請(qǐng)輸入您要?jiǎng)h除的聯(lián)系人姓名:n"); gets(name); head=Delete(head,name); break; case '4': printf("請(qǐng)您輸入要修改的聯(lián)系人的名字:"); gets(name); while(strlen(name)=0) gets(name); head=xiugai(head,name); break; case '5': Print_friends_Doc(head); break; case '6': save_
18、friend(head); break; case '7': head=sort_friend(head,name); break; case '8': printf("請(qǐng)選擇您的查詢方式:n"); printf("1.按姓名對(duì)聯(lián)系人進(jìn)行查找n"); printf("2.按電話號(hào)碼對(duì)聯(lián)系人進(jìn)行查找n"); printf("3.按QQ號(hào)碼對(duì)聯(lián)系人進(jìn)行查找n"); scanf("%d",&choices); while(choices<1|choices
19、>3)if(choices='n')printf("對(duì)不起,您輸入有誤!n");scanf("%d",&choices); switch(choices) case 1: printf("請(qǐng)輸入您要查詢的聯(lián)系人姓名:"); getchar(); gets(name); search_friend1(head,name); break; case 2: printf("請(qǐng)輸入您要查詢的聯(lián)系人電話號(hào)碼:"); getchar(); gets(phonenum); search_friend
20、2(head,phonenum); break; case 3: printf("請(qǐng)輸入您要查詢的聯(lián)系人QQ號(hào)碼:"); getchar(); gets(QQnumber); search_friend3(head,QQnumber); break; break; case '0': break; while(choice!='0'); return 0; 新建聯(lián)系人 struct friends_list *Create_Lianxi_Doc(struct friends_list *head) struct friends_list *p
21、,*tail; char name20; /姓名 char age5; /年齡 char sex5; /性別 char phonenumber15; /電話 char QQnumber12; /QQ號(hào)碼 char address80; /地址 char mail40; /電子郵箱 int flag=0; if(Count=100) /判斷通訊錄是否已已滿 printf("通訊錄已滿!n"); return 0; if(head!=NULL) /判斷鏈表是否為空 for(p=head;p;p=p->next) tail=p; p=NULL; p=(struct frie
22、nds_list*)malloc(sizeof(struct friends_list); /申請(qǐng)變量空間 printf("請(qǐng)輸入新的聯(lián)系人姓名:"); gets(name); if(strlen(name)=0) printf("對(duì)不起,聯(lián)系人姓名不能為空!n");gets(name); strcpy(p->name,name); printf("請(qǐng)輸入新建聯(lián)系人年齡:"); gets(age); strcpy(p->age,age); printf("請(qǐng)輸入新建聯(lián)系人性別:"); gets(sex)
23、; strcpy(p->sex,sex); printf("請(qǐng)輸入新建聯(lián)系人號(hào)碼:"); gets(phonenumber); strcpy(p->phonenumber,phonenumber); printf("請(qǐng)輸入新建聯(lián)系人QQ號(hào)碼:"); gets(QQnumber); strcpy(p->QQnumber,QQnumber); printf("請(qǐng)輸入新建聯(lián)系人的住址:"); gets(address); strcpy(p->address,address); printf("請(qǐng)輸入新建聯(lián)系
24、人電子郵箱:"); gets(mail); strcpy(p->mail,mail); p->next=NULL;if(head=NULL)head=p;elsetail->next=p;Count+;printf("新聯(lián)系人創(chuàng)建成功!"); return head; 讀取文件中已存聯(lián)系人struct friends_list *load_friend(struct friends_list *head)FILE *fp;char name20; /*姓名*/ char age5; /*年齡*/ char sex3; /*性別*/ char ph
25、onenumber15; char QQnumber12; char address80; char mail40;if(fp=fopen("通訊錄.txt","r")=NULL)printf("Cannot open file strike any key exit!n");exit(0);while(!feof(fp)fscanf(fp,"%sn",name);printf("姓名:");printf("%-10sn",name);fscanf(fp,"%sn&
26、quot;,age);printf("年齡:");printf("%-10sn",age);fscanf(fp,"%sn",sex);printf("性別:");printf("%-10sn",sex);fscanf(fp,"%sn",phonenumber);printf("電話:");printf("%-10sn",phonenumber);fscanf(fp,"%sn",QQnumber);printf(&qu
27、ot;QQ號(hào)碼:");printf("%-10sn",QQnumber);fscanf(fp,"%sn",address);printf("住址:");printf("%-10sn",address);fscanf(fp,"%sn",mail);printf("電子郵箱:");printf("%-10sn",mail);if(fclose(fp)printf("Cannot close this file!n");exit(0
28、);return head;printf("n讀入文件成功!n");刪除聯(lián)系人struct friends_list*Delete(struct friends_list*head,char *name) struct friends_list *ptr1,*ptr2; while(head!=NULL&&strcmp(head->name,name)=0) ptr2=head; head=head->next; free(ptr2); if(head=NULL) return NULL; ptr1=head; ptr2=head->nex
29、t; /從頭開始搜索符合要求的結(jié)點(diǎn) while(ptr2!=NULL) if(strcmp(ptr2->name,name)=0) ptr1->next=ptr2->next; free(ptr2); /釋放空間 else ptr1=ptr2; ptr2=ptr1->next; printf("刪除成功!"); return head;修改聯(lián)系人信息struct friends_list *xiugai(struct friends_list *head,char *name) struct friends_list*p; char age5; /年
30、齡 char sex3; /性別 char phonenumber15; /電話號(hào)碼 char QQnumber12; /QQ號(hào)碼 char address80; /地址 char mail40; /電子郵箱 int choice; int flag=0; if(Count=0) /判斷通訊錄是否為空 printf("通訊錄無記錄!無法進(jìn)行操作!"); return head; for(p=head;p;p=p->next) if(strcmp(name,p->name)=0) do printf("請(qǐng)選擇您要修改的內(nèi)容:n"); print
31、f("1.姓名n"); printf("2.年齡n"); printf("3.性別n"); printf("4.電話n"); printf("5.QQ號(hào)碼n"); printf("6.家庭住址n"); printf("7.電子郵箱n"); printf("0.退出n"); scanf("%d",&choice); getchar(); switch(choice) /選擇修改內(nèi)容 case 1: printf
32、("請(qǐng)輸入姓名:");gets(name);strcpy(p->name,name); break;case 2: printf("請(qǐng)輸入年齡:"); gets(age); strcpy(p->age,age); break; case 3: printf("請(qǐng)輸入性別:"); gets(sex); strcpy(p->sex,sex); break;case 4: printf("請(qǐng)輸入電話:"); gets(phonenumber); strcpy(p->phonenumber,phon
33、enumber); break;case 5: printf("請(qǐng)輸入QQ號(hào)碼:"); gets(QQnumber); strcpy(p->QQnumber,QQnumber); break; case 6: printf("請(qǐng)輸入家庭住址:"); gets(address);strcpy(p->address,address); break; case 7: printf("請(qǐng)輸入電子郵箱:"); gets(mail); strcpy(p->mail,mail); break; case 0: break; whi
34、le(choice!=0); flag=1; if(flag=1) /修改的判斷 printf("修改成功!n"); else printf("修改失敗!"); return head; 瀏覽聯(lián)系人信息void Print_friends_Doc(struct friends_list*head) struct friends_list*ptr; if(head=NULL) /判斷鏈表是否為空 printf("n無記錄!n"); return; for(ptr=head;ptr;ptr=ptr->next) /從第一個(gè)聯(lián)系人開始
35、循環(huán)輸出顯示所有聯(lián)系人信息 printf("n聯(lián)系人信息:n"); printf("姓名:"); printf("%sn",ptr->name); printf("年齡:"); printf("%sn",ptr->age); printf("性別:"); printf("%sn",ptr->sex); printf("電話:"); printf("%sn",ptr->phonenumber);
36、 printf("QQ號(hào)碼:"); printf("%sn",ptr->QQnumber); printf("住址:"); printf("%sn",ptr->address); printf("電子郵箱:"); printf("%sn",ptr->mail); 保存void save_friend(struct friends_list *head)FILE *fp;struct friends_list *p;int flag=0;if(fp=fopen
37、("通訊錄.txt","w")=NULL)printf("Cannot open file strike any key exit!n");exit(0);for(p=head;p;p=p->next)fprintf(fp,"%s ",p->name);if(strlen(p->age)=0)fprintf(fp,"%c ",'#');elsefprintf(fp,"n%sn",p->age);if(strlen(p->sex)=
38、0)fprintf(fp,"%c ",'#');elsefprintf(fp,"%s ",p->sex);if(strlen(p->phonenumber)=0)fprintf(fp,"%c ",'#');elsefprintf(fp,"%s ",p->phonenumber);if(strlen(p->QQnumber)=0)fprintf(fp,"%c ",'#');elsefprintf(fp,"%sn&qu
39、ot;,p->QQnumber);if(strlen(p->address)=0)fprintf(fp,"%c ",'#');elsefprintf(fp,"%sn",p->address);if(strlen(p->mail)=0)fprintf(fp,"%c ",'#');elsefprintf(fp,"%sn",p->mail);if(fclose(fp)printf("文件關(guān)閉錯(cuò)誤!n");flag=1;exit(0);if(
40、flag=0)printf("n所有聯(lián)系人已被成功保存!n");排序struct friends_list *sort_friend(struct friends_list *head,char *name) char age5; /*年齡*/ char sex3; /*性別*/ char phonenumber15; char QQnumber12; char address80; char mail40; struct friends_list*p1,*p2,*index; if(Count=0)printf("n此通訊錄為空!n");return
41、head; for(p1=head;p1->next!=NULL;p1=p1->next)index=p1;for(p2=p1->next;p2;p2=p2->next)if(strcmp(p2->name),(p1->name)<0)index=p2;strcpy(name,p1->name);strcpy(p1->name,index->name);strcpy(index->name,name);strcpy(age,p1->age);strcpy(p1->age,index->age);strcpy(i
42、ndex->age,age);strcpy(sex,p1->sex);strcpy(p1->sex,index->sex);strcpy(index->sex,sex);strcpy(phonenumber,p1->phonenumber);strcpy(p1->phonenumber,index->phonenumber);strcpy(index->phonenumber,phonenumber);strcpy(QQnumber,p1->QQnumber);strcpy(p1->QQnumber,index->QQnu
43、mber);strcpy(index->QQnumber,QQnumber);strcpy(address,p1->address);strcpy(p1->address,index->address);strcpy(index->address,address);strcpy(mail,p1->mail);strcpy(p1->mail,index->mail);strcpy(index->mail,mail);printf("n排序已完成!n");return head;按姓名對(duì)聯(lián)系人進(jìn)行查找void search_
44、friend1(struct friends_list *head,char *name)struct friends_list *p;int flag=0;if(Count=0)printf("n此通訊錄為空!n");return;for(p=head;p;p=p->next)if(strcmp(name,p->name)=0)printf("姓名:%sn",p->name);printf("年齡:%sn",p->age);printf("性別:%sn",p->sex);printf
45、("電話號(hào)碼:%sn",p->phonenumber);printf("QQ號(hào)碼:%sn",p->QQnumber);printf("住址:%sn",p->address);printf("電子郵箱:%sn",p->mail);flag=1;break;if(flag=0) printf("n輸入錯(cuò)誤或通訊錄中沒有此人!n");按電話號(hào)碼對(duì)聯(lián)系人進(jìn)行查找void search_friend2(struct friends_list *head,char *phonenum
46、ber)struct friends_list *p;int flag=0;if(Count=0)printf("n此通訊錄為空!n");return;for(p=head;p;p=p->next)if(strcmp(phonenumber,p->phonenumber)=0)printf("姓名:%sn",p->name);printf("年齡:%sn",p->age);printf("性別:%sn",p->sex);printf("電話號(hào)碼:%sn",p->
47、;phonenumber);printf("QQ號(hào)碼:%sn",p->QQnumber);printf("住址:%sn",p->address);printf("電子郵箱:%sn",p->mail);flag=1;break;if(flag=0) printf("n輸入錯(cuò)誤或通訊錄中沒有此人!n");按QQ號(hào)碼對(duì)聯(lián)系人進(jìn)行查找void search_friend3(struct friends_list *head,char *QQnumber)struct friends_list *p;int
48、 flag=0;if(Count=0)printf("n此通訊錄為空!n");return;for(p=head;p;p=p->next)if(strcmp(QQnumber,p->QQnumber)=0)printf("姓名:%sn",p->name);printf("年齡:%sn",p->age);printf("性別:%sn",p->sex);printf("電話號(hào)碼:%sn",p->phonenumber);printf("QQ號(hào)碼:%sn&
49、quot;,p->QQnumber);printf("住址:%sn",p->address);printf("電子郵箱:%sn",p->mail);flag=1;break;if(flag=0) printf("n輸入錯(cuò)誤或通訊錄中沒有此人!n");文件的掃描 struct friends_list *scanf_friend()FILE *fp;struct friends_list *p,*tail,*head;head=NULL;if(fp=fopen("通訊錄.txt","r&q
50、uot;)=NULL)printf("Cannot open file strike any key exit!n");exit(0);fseek(fp,0,2);if(ftell(fp)=0) printf("ttn");printf("tt通訊錄為空!n");printf("ttn");printf("ttt 請(qǐng)新建聯(lián)系人信息!n");head=NULL;elserewind(fp);while(!feof(fp)p=NULL;p=(struct friends_list*)malloc(s
51、izeof(struct friends_list);fscanf(fp,"%sn",p->name);fscanf(fp,"%sn",p->age);fscanf(fp,"%sn",p->sex);fscanf(fp,"%sn",p->phonenumber);fscanf(fp,"%sn",p->QQnumber);fscanf(fp,"%sn",p->address);fscanf(fp,"%sn",p->mail);p->next=NULL;if(head=NULL)head=
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年學(xué)校體育器材設(shè)施租賃合同
- 2025年企業(yè)內(nèi)部股權(quán)認(rèn)購合同范本
- 2025年跨區(qū)域金融協(xié)同發(fā)展策劃框架協(xié)議
- 2025年醫(yī)療設(shè)備租賃與維護(hù)合作協(xié)議
- 2025年勞保服裝定制合同樣本
- 2025年企業(yè)合作社交媒體代運(yùn)營(yíng)合同
- 2025年建筑工程策劃環(huán)境風(fēng)險(xiǎn)評(píng)估合作協(xié)議
- 2025年中期票據(jù)發(fā)行保證合同樣本
- 2025年中介電子商務(wù)合同
- 2025年農(nóng)村耕地整合策劃協(xié)同協(xié)議
- 店鋪轉(zhuǎn)讓資金分期合同范本
- 法律法規(guī)合規(guī)性評(píng)價(jià)分析報(bào)告
- HG-T 2006-2022 熱固性和熱塑性粉末涂料
- 老舍《駱駝祥子》名著讀后感
- 齊魯書社四年級(jí)傳統(tǒng)文化教案第三單元 交友之道
- JTT 680.1-2016 船用通信導(dǎo)航設(shè)備的安裝、使用、維護(hù)、修理技術(shù)要求 第1部分:總則
- 社區(qū)衛(wèi)生服務(wù)機(jī)構(gòu)社會(huì)實(shí)踐報(bào)告
- 2024年湖南高速鐵路職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)適應(yīng)性測(cè)試題庫附答案
- 2024年江蘇農(nóng)牧科技職業(yè)學(xué)院?jiǎn)握新殬I(yè)適應(yīng)性測(cè)試題庫附答案
- 五年級(jí)口算1000題(打印版)
- 2024年西安亮麗電力集團(tuán)有限責(zé)任公司招聘筆試參考題庫附帶答案詳解
評(píng)論
0/150
提交評(píng)論