资源描述:
《人事管理系统vc代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、人事管理系统VC代码#include#include#include#defineN100structmember_info{charxm[7];charxb[3];charsr[15];charwhcd[13];charzc[17];charsfzh[19];charlxdh[12];intgl;intnl;};structmember_infomember[N+1];intCurrentCount=0;voidinput(){charsfjx=1;while(sfjx!=0){if(CurrentCount==N)
2、{printf("人数已达上限,不能添加!!!");sfjx=0;}else{CurrentCount++;printf("请输入员工信息(姓名性别生日年龄文化程度联系电话身份证号码工龄职称):");scanf("%s%s%s%d%s%s%s%d%s",member[CurrentCount].xm,member[CurrentCount].xb,member[CurrentCount].sr,&member[CurrentCount].nl,member[CurrentCount].whcd,member[CurrentCount].lxdh,member[
3、CurrentCount].sfzh,&member[CurrentCount].gl,member[CurrentCount].zc);printf("是否继续(0--结束,其它--继续):");scanf("%d",&sfjx);}}printf("人员已排序");inti,j;for(i=1;ii;j--)if(strcmp(member[j].sfzh,member[j-1].sfzh)<0){member[0]=member[j];member[j]=member[j-1];membe
4、r[j-1]=member[0];}printf("人事基本信息表");printf("序号 姓名性别生日年龄文化程度联系电话身份证号码工龄职称");for(i=1;i<=CurrentCount;i++)printf("%4d%6s%3s%11s%3d%8s%12s%20s%3d%5s",i,member[i].xm,member[i].xb,member[i].sr,member[i].nl,member[i].whcd,member[i].lxdh,member[i].sfzh,member[i].gl,member[i].zc);system("pau
5、se");}voidsave(){FILE*fp;fp=fopen("ygjbxx.txt","w");if(fp==NULL)printf("文件打开不成功,信息无法保存!!!");else{fprintf(fp,"%d",CurrentCount);for(inti=1;i<=CurrentCount;i++)fprintf(fp,"%8s%4s%16s%4d%14s%13s%20s%4d%18s",member[i].xm,member[i].xb,member[i].sr,member[i].nl,member[i].whcd,member[i].lxdh
6、,member[i].sfzh,member[i].gl,member[i].zc);fclose(fp);printf("信息已成功保存!!!");}system("pause");}voidread(){FILE*fp;fp=fopen("ygjbxx.txt","r");if(fp==NULL)printf("文件打开不成功,信息无法读取!!!");else{fscanf(fp,"%d",&CurrentCount);for(inti=1;i<=CurrentCount;i++){fscanf(fp,"%s%s%s%d%s%s%s%d%s",member
7、[i].xm,member[i].xb,member[i].sr,&member[i].nl,member[i].whcd,member[i].lxdh,member[i].sfzh,&member[i].gl,member[i].zc);printf("姓名:%s 性别:%s 生日:%s 年龄:%d文化程度:%s联系电话:%s身份证号码:%s工龄:%d职称:%s",member[i].xm,member[i].xb,member[i].sr,member[i].nl,member[i].whcd,