欢迎来到天天文库
浏览记录
ID:49270331
大小:48.00 KB
页数:12页
时间:2020-02-28
《c语言企业员工管理系统.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、全部源代码:#include#include#include#include#defineMAX100charfilename[20];/*文件名*/FILE*fp;intn;/*当前该厂人数*/structdate/*时间结构体*/{intyear;intmouth;intday;};structperson/*员工信息结构体*/{charname[10];/*姓名*/intage;/*年龄*/charjob[10];/*工作*/charsex[10];/*性别*/char
2、address[20];/*地址*/charphone[10];/*电话*/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){prin
3、tf("不能建立!");exit(0);}for(i=0;i4、.address);printf("电话");scanf("%s",worker[i].phone);printf("入厂年");scanf("%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、s%s%s%s%d-%d-%d",worker[i].name,worker[i].age,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);}/*输出模块*/voidoutput(){inti;if((fp=fopen(filename,"r"))==NULL){printf("暂时未有任何信息,请按任意键返回主6、菜单进行信息录入");getch();exit(0);}system("cls");printf("该厂的员工信息:");printf("姓名t年龄t工作t性别t地址t电话t入厂时间");for(i=0;i7、r[i].in_time.mouth,&worker[i].in_time.day);printf("%st%dt%st%st%st%st%d-%d-%d",worker[i].name,worker[i].age,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("输出完毕,按任意键返8、回主菜单");getch();}/*保存模块*/voidsave(){inti;if((fp=fopen
4、.address);printf("电话");scanf("%s",worker[i].phone);printf("入厂年");scanf("%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、s%s%s%s%d-%d-%d",worker[i].name,worker[i].age,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);}/*输出模块*/voidoutput(){inti;if((fp=fopen(filename,"r"))==NULL){printf("暂时未有任何信息,请按任意键返回主6、菜单进行信息录入");getch();exit(0);}system("cls");printf("该厂的员工信息:");printf("姓名t年龄t工作t性别t地址t电话t入厂时间");for(i=0;i7、r[i].in_time.mouth,&worker[i].in_time.day);printf("%st%dt%st%st%st%st%d-%d-%d",worker[i].name,worker[i].age,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("输出完毕,按任意键返8、回主菜单");getch();}/*保存模块*/voidsave(){inti;if((fp=fopen
5、s%s%s%s%d-%d-%d",worker[i].name,worker[i].age,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);}/*输出模块*/voidoutput(){inti;if((fp=fopen(filename,"r"))==NULL){printf("暂时未有任何信息,请按任意键返回主
6、菜单进行信息录入");getch();exit(0);}system("cls");printf("该厂的员工信息:");printf("姓名t年龄t工作t性别t地址t电话t入厂时间");for(i=0;i7、r[i].in_time.mouth,&worker[i].in_time.day);printf("%st%dt%st%st%st%st%d-%d-%d",worker[i].name,worker[i].age,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("输出完毕,按任意键返8、回主菜单");getch();}/*保存模块*/voidsave(){inti;if((fp=fopen
7、r[i].in_time.mouth,&worker[i].in_time.day);printf("%st%dt%st%st%st%st%d-%d-%d",worker[i].name,worker[i].age,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("输出完毕,按任意键返
8、回主菜单");getch();}/*保存模块*/voidsave(){inti;if((fp=fopen
此文档下载收益归作者所有