c语言工资管理系统链表6,急求!!!关于职工工资管理系统的C++ 链表

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

#include

#include

#include

#include

const int n=10;

struct employee

{ char num; //个人编号

char name;

char sex;

char birthday; //生日

char grade; //职称

char degree; //学历

char sumPay; //月薪

char marry; //婚否

struct employee *next;

}em[n];

void add(employee *top); //增加函数

void delete1(employee *top); //删除函数

void edit(employee *top); //修改函数

void display(employee *top); //显示人员信息

void delete1(employee *top) //删除函数

{char choose[2],input1[30];

int cn=0;

cout<

cout<

cout<

gets(choose);

while(1)

{cn=atoi(choose);

if(cn!=1&&cn!=2)

{cout<

gets(choose);

}

switch(cn)

{case 1:

cout<

case 2:

cout<

}

gets(input1);

employee *old,*star;

old=star=top;

while(star!=NULL)

{if((cn==1&&strcmp(input1,star->num)==0)||(cn==2&&strcmp(input1,star->name)==0))

{if(star==top)

top=star->next;

else

old->next=star->next;

cout<

cout<

cout<

cout<num<name<sex<birthday<grade<degree<sumPay<marry;"<

}

void add(employee *top) //增加函数

{

{int x;

employee *m,*q=new employee;

cout<

cin>>top->num>>top->name>>top->sex>>top->birthday>>top->grade>>top->degree>>top->sumPay>>top->marry;

cout<

cin>>x;

for(int i=0;p!=NULL&&i

{m=top;

top++;}

if(top==NULL)

{cout<

m->next=q;q->next=NULL;}

else

{m->next=q;q->next=top;}

}

cout<

}

void save(employee *top) //保存函数

{ofstream out;

out.open("employee.txt",ios::out);

if(!out)

{cout<

exit(1);

}

cout<

employee *p=top;

while(p!=NULL)

{out<

p=p->next;

}

cout<

out.close();

}

void input(employee *top) //输入函数

{ ifsteam in;

in.open("employee.txt",ios::in|ios::nocreate);

if(!in) //判断是否有文件

{cout<

}

else

{in.close();

cout<

employee *old,*star;

old=top;

while(old->next!=NULL)

{old=old->next;}

cout<

cout<

gets(star->num);

if(strcmp(star->num,'0')==0) break;

cout<

gets(star->name);

cout<

gets(star->sex);

cout<

cin>>star->birthday;

cout<

gets(star->grade);

cout<

gets(star->degree);

cout<

gets(star->marry);

if(top->count==0) top=star;

old->next=star;

old=star;

}

while(1)

old->next=NULL;

return(top);

}

void find(employee *top) //查找函数

{char choose[2],input1[30];

int cn=0;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值