文档详情

c语言课程设计.职工信息管理系统源程序.pdf

发布:2018-10-22约1.19万字共23页下载文档
文本预览下载声明
C语言课程设计——职工信息管理系统源程序 #includelt;stdio.hgt; #includelt;stdlib.hgt; #includelt;string.hgt; #define LEN sizeof(struct worker) struct worker { int num; char name[10]; char sex[3]; int age; int sale; int telephone; struct worker *next; }; //主函数 void main() { int i,m,x,number,num; struct worker *create(); struct worker *insert(struct worker *head,struct worker *p); struct worker *delet(struct worker *head,int num); void print(struct worker *head); struct worker *search(struct worker *head,int m); struct worker *edit(struct worker *head,int number); void sort(struct worker *head); void menu_select(); void save(struct worker *head); void read(struct worker *head); struct worker *head,*p,*p1; printf(quot;++\nquot;); printf(quot;| |\nquot;); printf(quot;| 欢迎使用职工信息管理系统 |\nquot;); printf(quot;| |\nquot;); printf(quot;++\nquot;); printf(quot;\n\n\nquot;); x 1; while(x)// x x ! 用 控制执行的次数,当 为零时则结束 { menu_select(); printf(quot; 1 8 :quot;); 输入一个数字在 到 之间 scanf(quot;%dquot;,amp;i); switch(i) { case 1: //创建整个链表 printf(quot;\t\t\t 创建链表!\nquot;); head create(); print(head); break; case 2: printf(quot;\n你选择的是查找!\nquot;); printf(quot;请输入你要查找的职工工资:quot;); scanf(quot;%dquot;,amp;m); search(head,m); break; case 3: printf(quot;\n你选择的是插入!\nquot;); printf(quot;请输入你要插入的记录:\nquot;); p (struct worker *)malloc(sizeof(struct worker)); p1 (struct worker *)malloc(sizeof(struct worker)); printf(quot;number:quot;); scanf(quot;%dquot;,amp;p-gt;num); p1 head; while(p1-gt;num! p-gt;numamp;amp;p1-gt;next! N ULL) p1 p1-gt;next; if(p1-gt;next! NULL) printf(quot;你输入的已有记录请重新选择, !\nquot;); if(p1-gt;next NULL) { printf(quot;请输入其余信息\nquot;); printf(quot;name sex age sale telephone\
显示全部
相似文档