1 / 15
文档名称:

员工管理系统数据结构课程设计.doc

格式:doc   页数:15页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

员工管理系统数据结构课程设计.doc

上传人:cdsqbyl 2015/8/25 文件大小:0 KB

下载得到文件列表

员工管理系统数据结构课程设计.doc

文档介绍

文档介绍:/**/
#include""
#include""
#include ""
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define OVERFLOW -2
typedef struct LNode
{
char id[20];
char name[10];
char sex[10];
char birth[10];
char edu[10];
char duty[10];
char phone[20];
char address[30];
struct LNode *next;
}LNode,*Linklist;//定义节点类型
int CreatList(Linklist &L)
{
Linklist p;
p=(Linklist)malloc(sizeof(LNode));
if(!p)
{
return (0);
}
else
{
printf("请输入员工编号\n");
scanf("%s",p->id);
printf("请输入员工姓名\n");
scanf("%s",p->name);
printf("请输入员工性别\n");
scanf("%s",p->sex);
printf("请输入员工生日\n");
scanf("%s",p->birth);
printf("请输入员工学历\n");
scanf("%s",p->edu);
printf("请输入员工职务\n");
scanf("%s",p->duty);
printf("请输入员工电话\n");
scanf("%s",p->phone);
printf("请输入员工地址\n");
scanf("%s",p->address);
}
p->next=L->next;
L->next=p;
}//头插法生成单链表
int Initlist(Linklist &L)
{
L=(Linklist)malloc(sizeof(LNode));
if(!L)
return (0);
L->next=NULL;
return OK;
}//初始化单链表
void Display(Linklist &L)
{
Linklist p;
for(p=L->next;p;p=p->next)
{
printf("编号%s\n",p->id);
printf("姓名%s\n",p->name);
printf("性别%s\n",p->sex);
printf("生日%s\n",p->birth);
printf("学历%s\n",p->edu);
printf("职务%s\n",p->duty);
printf("电话%s\n",p->phone);
printf("地址%s\n",p->address);
printf("============================\n");
}
}//显示所有员工信息
int SearchID(Linklist &L,char id[20])
{
LNode *p;
p=L;
while(p)
{
if(strcmp(p->id,id)==0)
{
printf("编号%s\n",p->id);
printf("姓名%s\n",p->name);
printf("性别%s\n",p->sex);
printf("生日%s\n",p->birth);
printf("学历%s\n",p->edu);
printf("职务%s\n",p->duty);
printf("电话%s\n",p->phone);
printf("地址%s\n",p->address);
}
p=p->next;
}
return OK;
}//ID查询
int SearchName(Linklist &L,char name[10])
{
LNode *p;
p=L;
while(p)
{
if(strcmp(p->name,name)==0)
{
printf("编号%s\n",p->id);
printf("姓名%s\n",p->name);
printf("性别%s\n",p->sex);
printf("生日%s\n",p->b