资源描述:
《员工工资管理系统(c语言编程).docx》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、#include#include#include#include#definenull0typedefstructInfo1{charnum[10];charname[10];chardepar[10];charyfsalary[10];charaband[10];chartax[10];charsfsalary[10];structInfo1*next;}Info2;typedefstructInfo1*Info;Infohead
2、;voiddisplay();voidfind();voidmodify();voidadd();voiddel();voidlist();voidlistOne(Infos);InfoisExists(char*num);voidinit();voidinit(){head=(Info)malloc(sizeof(Info2));head->next=null;}voidmain(){init();while(1){charc;display();scanf("%c",&c);switch(c){case
3、'1':find();break;case'2':add();break;case'3':modify();break;case'4':del();break;case'5':list();break;case'6':printf("tt...退出系统!");return;default:printf("tt输入错误!请按任意键返回重新选择(1-7)");getchar();}}}voiddisplay(){printf("t**欢迎使用员工信息管理系统**");printf(
4、"t请选(1-7):");printf("t============================================");printf("tt1.查询员工信息");printf("tt2.录入员工信息");printf("tt3.修改员工信息");printf("tt4.删除员工信息");printf("tt6.显示所有员工信息");printf("tt7.退出系统");printf("t=====================
5、=======================");printf("t您的选择是:");}voidlistOne(Infop){printf("该员工信息记录如下:");printf("==========================================================");printf("%-12s%-10s%-10s%-7s%-7s%-10s%-10s%","员工编号","姓名","部门","应付工资","保险","税金","实付工资");pri
6、ntf("%-12s%-10s%-10s%-7s%-7s%-10s%-10s%",p->num,p->name,p->depar,p->yfsalary,p->aband,p->tax,p->sfsalary);}InfoisExists(char*num){Infop,q;p=head;q=p->next;while(q!=null){if(strcmp(q->num,num)==0)returnp;p=q;q=p->next;}returnp;}voidadd(){Infop,q;charnum[1
7、0];q=(Info)malloc(sizeof(Info2));printf("tt请输入员工编号:");scanf("%s",num);p=isExists(num);if(p->next==null){strcpy(q->num,num);printf("tt请输入员工姓名:");scanf("%s",q->name);printf("tt请输入该员工的部门:");scanf("%s",q->depar);printf("tt请输入该员工的应付工资金额:");scanf("%s",q-
8、>yfsalary);printf("tt请输入该员工的保险金额:");scanf("%s",q->aband);printf("tt请输入该员工的税金金额:");scanf("%s",q->tax);printf("tt请输入该员工的实付工资:");scanf("%s",q->sfsalary);q->next=null;p->next=q;}elseprintf("tt您所输入的员工编号以