完整word版通讯录管理系统源代码Word文档格式.docx

上传人:b****1 文档编号:6116157 上传时间:2023-05-06 格式:DOCX 页数:22 大小:16.84KB
下载 相关 举报
完整word版通讯录管理系统源代码Word文档格式.docx_第1页
第1页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第2页
第2页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第3页
第3页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第4页
第4页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第5页
第5页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第6页
第6页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第7页
第7页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第8页
第8页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第9页
第9页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第10页
第10页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第11页
第11页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第12页
第12页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第13页
第13页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第14页
第14页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第15页
第15页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第16页
第16页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第17页
第17页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第18页
第18页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第19页
第19页 / 共22页
完整word版通讯录管理系统源代码Word文档格式.docx_第20页
第20页 / 共22页
亲,该文档总共22页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

完整word版通讯录管理系统源代码Word文档格式.docx

《完整word版通讯录管理系统源代码Word文档格式.docx》由会员分享,可在线阅读,更多相关《完整word版通讯录管理系统源代码Word文档格式.docx(22页珍藏版)》请在冰点文库上搜索。

完整word版通讯录管理系统源代码Word文档格式.docx

intsearch();

intdisplay();

intadd();

intlistbyname();

intdele();

intsave();

intexit();

voidmain()

system(cls);

for(;

;

{

switch(menu_select())

case0:

adduser();

break;

case1:

list();

case2:

search();

case3:

display();

case4:

add();

case5:

listbyname();

case6:

dele();

case7:

save();

case8:

exit(0);

}

}

menu_select()

chars[80];

inta;

printf(*_*pressanykeyentermenu!

*_*\n);

getch();

printf(\\t********************MENU*********************\n\n);

printf(\\t0.输入记录\n);

printf(\\t1.显示记录\n);

printf(\\t2.按姓名查找\n);

printf(\\t3.按电话号码查找\n);

printf(\\t4.插入记录\n);

printf(\\t5.按姓名排序\n);

printf(\\t6.删除记录\n);

printf(\\t7.记录保存文件\n);

printf(\\t8.Quit\n);

printf(\\t***********************************************\n);

do{

printf(\

Enteryouchoice(0~11):

);

scanf(%s,s);

a=atoi(s);

while(a<

0||a>

11);

returna;

adduser()

\t\t****************请输入用户信息****************\n);

\t\t输入姓名:

scanf(%s,&

student[num].name);

\t\t输入电话号码:

student[num].phone);

\t\t输入地址:

student[num].adress);

\t\t输入邮编:

student[num].postcode);

\t\t输入e-mail:

student[num].e_mail);

num++;

\t\t是否继续添加?

(Y/N):

if(getch()=='

y'

adduser();

return(0);

list()

inti;

if(num!

=0)

\t\t***************以下为通讯录所有信息************);

for(i=0;

i<

num;

i++)

\t\t姓名:

%s,student[i].name);

\t\t电话:

%s,student[i].phone);

\t\t地址:

%s,student[i].adress);

\t\t邮编:

%s,student[i].postcode);

\t\te-mail:

%s,student[i].e_mail);

printf(\\t);

if(i+1<

num)

\t\t__________________________);

system(pause);

\t\t************************************************);

else

\t\t通讯录中无任何纪录);

\t\t按任意键返回主菜单:

return(0);

search()

intmark=0;

inta=0;

\t\t*****************按姓名查找*******************);

charname[20];

\t\t请输入姓名:

scanf(%s,name);

for(i=a;

if(strcmp(student[i].name,name)==0)

\t\t*************以下是您查找的用户信息***********);

mark++;

if((i+1)<

\t\t是否继续查找相同名字的用户信息:

(y/n));

if(getch()=='

a=i;

continue;

\t\t按任意键返回主菜单);

if(mark!

\t\t没有相同姓名的用户纪录);

display()

intmark=0;

inti;

inta=0;

printf(\

\t\t******************按电话查找******************);

charphone[10];

\t\t请输入电话号码:

scanf(%s,phone);

for(i=0;

if(strcmp(student[i].phone,phone)==0)

\t\t**************以下是您查找的用户信息**********);

if(mark==0)

\t\t没有改用户的信息);

add()

if((fp=fopen(student.bin,wb))==NULL)

\t\t文件打开失败);

if(fwrite(&

student[i],sizeof(structrecord),1,fp)!

=1)

\t\t写入文件错误!

\n);

fclose(fp);

\t\t通讯录文件已保存);

\n\t\t);

按任意键退出程序printf(\

\t\t

exit(0);

voiddeletebyphone()

inti,j;

intdeletemark=0;

\t\t请输入要删除用户电话号码:

scanf(%s,phone);

if(num==0)

\t\t对不起,文件中无任何纪录);

return;

if(strcmp(student[i].phone,phone)==NULL)

\t\t以下是您要删除的用户纪录:

\t\t是否删除?

for(j=i;

j<

num-1;

j++)

student[j]=student[j+1];

num--;

deletemark++;

\t\t删除成功);

\t\t是否继续删除?

deletebyphone();

if(deletemark==0)

\t\t没有该用户的纪录);

voiddeletebyname()

intfindmark=0;

intj;

\t\t请输入要删除用户姓名:

for(i=a;

if(strcmp(student[i].name,name)==NULL)

findmark++;

\t\t________________________________);

if((i+1)<

\t\t是否继续删除相同姓名的用户信息?

deletebyname();

else

continue;

if((deletemark==0)&

&

(findmark==0))

elseif(findmark!

\t\t没有重名信息);

dele()

charchoic;

\t\t1-按电话号码删除2-按姓名删除);

\t\t请选择:

choic=getch();

switch(choic)

case'

1'

:

deletebyphone();

2'

deletebyname();

listbyname()

inti,j;

structrecordtmp;

for(i=1;

if(strcmp(student[i].name,student[i-1].name)<

0)

tmp=student[i];

j=i-1;

do

student[j+1]=student[j];

j--;

}while((strcmp(tmp.name,student[j].name)<

0&

j>

=0));

student[j+1]=tmp;

\t\t排序成功,是否显示?

list();

save()

intj;

FILE*fp;

fp=fopen(student.txt,w);

if(fp==NULL)

printf(can'

topenthefile.);

for(j=0;

fwrite(student,sizeof(student),1,fp);

牰湩晴尨保存成功!

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 党团工作 > 入党转正申请

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2