用C语言编写管理联络方式的小系统.doc

上传人:cl****1 文档编号:544491305 上传时间:2023-03-13 格式:DOC 页数:18 大小:43.50KB
返回 下载 相关 举报
用C语言编写管理联络方式的小系统.doc_第1页
第1页 / 共18页
用C语言编写管理联络方式的小系统.doc_第2页
第2页 / 共18页
用C语言编写管理联络方式的小系统.doc_第3页
第3页 / 共18页
用C语言编写管理联络方式的小系统.doc_第4页
第4页 / 共18页
用C语言编写管理联络方式的小系统.doc_第5页
第5页 / 共18页
点击查看更多>>
资源描述

《用C语言编写管理联络方式的小系统.doc》由会员分享,可在线阅读,更多相关《用C语言编写管理联络方式的小系统.doc(18页珍藏版)》请在金锄头文库上搜索。

1、用C语言编写管理联络方式的小系统#include#include#include#define LEN sizeof(struct linkinfo)struct linkinfo struct linkinfo *first; char name20; char place128; char birthday11; char telephone16; struct linkinfo *next;int datacount = 0,sortname,sorttype;struct linkinfo *p_main,*p_first=NULL,*p_tail = NULL;int checkem

2、pty(char temp) int flag = 0,i; if(strlen(temp) = 0) flag = 1; for(i=0;istrlen(temp);i+) if(int)tempi = 32 | (int)tempi = 129) flag = 1; else flag = 0; return(flag);struct linkinfo *create(int number) struct linkinfo *new; int i,flag = 0; char temp20; for(i=0; iname); strcpy(temp,new-name); flag = ch

3、eckempty(temp); if(flag = 1) free(new); break; printf(Please input place:); gets(new-place); printf(please input birthday:); gets(new-birthday); printf(Please input telephone:); gets(new-telephone); new-next = NULL; new-first = NULL; if(p_first = NULL) p_first = new; else new-first = p_tail; p_tail-

4、next = new; p_tail = new; datacount+; void showtopmenu() fflush(stdin); printf(*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- Menu -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*n); printf(1 add *n); printf(2 update *n); printf(3 delete *n); printf(4 showall *n); printf(5 showone *n); printf(6 sort *n); printf(-*n); printf(7

5、read data from file *n); printf(8 write data to file *n); printf(-*n); printf(0 exit *n); printf(*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*n); printf(Please choice a command);void process_add() create(1); showtopmenu();void process_update() int i = 1,index,flag; char t

6、emp20; printf(Please input the data index that you want to update:); fflush(stdin); scanf(%d,&index); p_main = p_first; if(index datacount | index name); printf(Number%ds place:t%sn,index,p_main-place); printf(Number%ds birthday:t%sn,index,p_main-birthday); printf(Number%ds telephone:t%sn,index,p_ma

7、in-telephone); fflush(stdin); printf(Please input new name:); gets(temp); flag = checkempty(temp); if(flag = 1) printf(New name input error!n); break; else strcpy(p_main-name,temp); printf(Please input new place:); gets(p_main-place); printf(Please input new birthday:); gets(p_main-birthday); printf

8、(Please input new telephone:); gets(p_main-telephone); break; else i+; p_main = p_main-next; showtopmenu();void process_delete() int i = 1,index; printf(Please input the data index that you want to delete:); scanf(%d,&index); p_main = p_first; if(index 0) while(p_main != NULL) if(index = 1) if(p_main-next = NULL) datacount = 0;

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号