欢迎来到天天文库
浏览记录
ID:47367028
大小:17.10 KB
页数:12页
时间:2019-07-29
《c语言企业员工管理系统》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、全部源代码:#include#include#include#include#defineMAX100charfilename[20];/文件名/FILE*fp;intn;/当前该厂人数/structdate/时间结构体/{intyear;intmouth;intday;};structperson/员工信息结构体/{charname[10];/姓名/intage;/年龄/charjob[10];/工作/charsex[10];/性别/charaddress[20];/地址/charphone[10]
2、;/电话/structdatein_time;/入厂时间/}t,worker[MAX];/录入模块/voidinput(){inti;system("cls");//system("cls");printf("请输入文件名");scanf("%s",filename);printf("开始输入员工的信息");printf("请输入现有员工人数");scanf("%d",&n);if((fp=fopen(filename,"w"))==NULL){printf("不能建立!");exit(0);}for(i=0;i3、d个人的信息:",i+1);printf("姓名");scanf("%s",worker[i].name);printf("年龄");scanf("%d",&worker[i].age);printf("工作");scanf("%s",worker[i].job);printf("性别");scanf("%s",worker[i].sex);printf("地址");scanf("%s",worker[i].address);printf("电话");scanf("%s",worker[i].phone);printf("入厂年");scanf4、("%d",&worker[i].in_time.year);printf("入厂月");scanf("%d",&worker[i].in_time.mouth);printf("入厂日");scanf("%d",&worker[i].in_time.day);}printf("录入完毕,按任意键返回主菜单");getch();for(i=0;i5、ddress,worker[i].phone,worker[i].in_time.year,worker[i].in_time.mouth,worker[i].in_time.day);fclose(fp);}/输出模块/voidoutput(){inti;if((fp=fopen(filename,"r"))==NULL){printf("暂时未有任何信息,请按任意键返回主菜单进行信息录入");getch();exit(0);}system("cls");printf("该厂的员工信息:");printf("姓名t年龄t工作t性别t地址t电话t入厂时间6、n");for(i=0;i7、,worker[i].job,worker[i].sex,worker[i].address,worker[i].phone,worker[i].in_time.year,worker[i].in_time.mouth,worker[i].in_time.day);}fclose(fp);printf("输出完毕,按任意键返回主菜单");getch();}/保存模块/voidsave(){inti;if((fp=fopen(filename,"w"))==NULL)/打开文件/{printf("
3、d个人的信息:",i+1);printf("姓名");scanf("%s",worker[i].name);printf("年龄");scanf("%d",&worker[i].age);printf("工作");scanf("%s",worker[i].job);printf("性别");scanf("%s",worker[i].sex);printf("地址");scanf("%s",worker[i].address);printf("电话");scanf("%s",worker[i].phone);printf("入厂年");scanf
4、("%d",&worker[i].in_time.year);printf("入厂月");scanf("%d",&worker[i].in_time.mouth);printf("入厂日");scanf("%d",&worker[i].in_time.day);}printf("录入完毕,按任意键返回主菜单");getch();for(i=0;i5、ddress,worker[i].phone,worker[i].in_time.year,worker[i].in_time.mouth,worker[i].in_time.day);fclose(fp);}/输出模块/voidoutput(){inti;if((fp=fopen(filename,"r"))==NULL){printf("暂时未有任何信息,请按任意键返回主菜单进行信息录入");getch();exit(0);}system("cls");printf("该厂的员工信息:");printf("姓名t年龄t工作t性别t地址t电话t入厂时间6、n");for(i=0;i7、,worker[i].job,worker[i].sex,worker[i].address,worker[i].phone,worker[i].in_time.year,worker[i].in_time.mouth,worker[i].in_time.day);}fclose(fp);printf("输出完毕,按任意键返回主菜单");getch();}/保存模块/voidsave(){inti;if((fp=fopen(filename,"w"))==NULL)/打开文件/{printf("
5、ddress,worker[i].phone,worker[i].in_time.year,worker[i].in_time.mouth,worker[i].in_time.day);fclose(fp);}/输出模块/voidoutput(){inti;if((fp=fopen(filename,"r"))==NULL){printf("暂时未有任何信息,请按任意键返回主菜单进行信息录入");getch();exit(0);}system("cls");printf("该厂的员工信息:");printf("姓名t年龄t工作t性别t地址t电话t入厂时间
6、n");for(i=0;i7、,worker[i].job,worker[i].sex,worker[i].address,worker[i].phone,worker[i].in_time.year,worker[i].in_time.mouth,worker[i].in_time.day);}fclose(fp);printf("输出完毕,按任意键返回主菜单");getch();}/保存模块/voidsave(){inti;if((fp=fopen(filename,"w"))==NULL)/打开文件/{printf("
7、,worker[i].job,worker[i].sex,worker[i].address,worker[i].phone,worker[i].in_time.year,worker[i].in_time.mouth,worker[i].in_time.day);}fclose(fp);printf("输出完毕,按任意键返回主菜单");getch();}/保存模块/voidsave(){inti;if((fp=fopen(filename,"w"))==NULL)/打开文件/{printf("
此文档下载收益归作者所有