预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共11页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

#include<stdio.h>#include<string.h>#include<stdlib.h>#include<conio.h>enumSex{nan,nv};/*性别*/structDate/*日期*/{intyear;intmonth;intday;};structInfo{charnum[11];/*职工号*/charname[10];/*姓名*/enumSexsex;/*性别*/structDatebirthday;/*出生年月*/chareducation[16];/*学历*/charduty[30];/*职务*/doublewage;/*工资*/charaddr[30];/*地址*/charphone[12];/*电话*/};charmenu()/*菜单选择函数*/{charn;/*n记录选择的菜单*/system("cls");/*清屏*/puts("\t\t\t\t欢迎进入职工信息管理系统");puts("\t\t***************************菜单***************************\n");puts("\t\t\t\t\t1.职工信息录入功能\n");puts("\t\t\t\t\t2.职工信息浏览功能\n");puts("\t\t\t\t\t3.职工信息查询功能\n");puts("\t\t\t\t\t4.职工信息修改功能\n");puts("\t\t\t\t\t5.职工信息删除功能\n");puts("\t\t\t\t\t6.退出\n");puts("\t\t**********************************************************\n");printf("\t\t请选着你要操作模块儿的序号(1-6):[]\b\b");while(1){n=getchar();getchar();if(n<'1'||n>'6')printf("\t\t输入错误,请重新输入(1-6):[]\b\b");elsebreak;}returnn;}voidappend()/*信息输入函数*/{structInfoinfo;FILE*fp;charch;chartemp[10];if((fp=fopen("inform.txt","ab"))==NULL){printf("\t\t对不起,文件打开失败!");getch();menu();}do{printf("\t\t工号:");gets(info.num);printf("\t\t姓名:");gets(info.name);printf("\t\t性别(男/女):");gets(temp);if(!strcmp(temp,"男"))info.sex=nan;elseinfo.sex=nv;printf("\t\t出生日期:(yyyy/mm/dd):");scanf("%d/%d/%d",&info.birthday.year,&info.birthday.month,\&info.birthday.day);getchar();printf("\t\t学历:");gets(info.education);printf("\t\t职务:");gets(info.duty);printf("\t\t工资:");gets(temp);info.wage=atof(temp);printf("\t\t住址:");gets(info.addr);printf("\t\t电话:");gets(info.phone);fwrite(&info,sizeof(info),1,fp);printf("\t\t还要输入其它职工信息吗?(Y/N):[]\b\b");ch=getchar();getchar();}while(ch=='Y'||ch=='y');fclose(fp);}voidprint1(){printf("%-11s%-10s%-8s%-12s%-16s%-30s%-15s%-30s%-12s\n","工号","姓名",\"性别","出生日期","学历","职务","工资","住址","电话");}voidprint2(structInfoinfo){printf("%-11s%-10s%",info.num,info.n