资源描述:
《c语言职工管理系统源代码及运行截图(简单版)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#include#include#defineN100typedefstructworker{charname[20];longnumber;inty,m,d;charzhicheng[20];charbumen[20];floatsalary;}Worker;voidDisplay(){printf("tt***************职工管理系统*************");printf("ttt0.退tt出");printf("t
2、tt1.新tt建");printf("ttt2.显tt示");printf("ttt3.查tt询");printf("ttt4.删tt除");}/*******1.新建**********/voidAdd(Workerw[],intn){inti;printf("t姓名t工号t进场时间t职称t部门t工资");for(i=0;i3、].name,&w[i].number,&w[i].y,&w[i].m,&w[i].d,w[i].zhicheng,w[i].bumen,&w[i].salary);}}/*******2.显示**********/voidBrowse(Workerw[],intn){inti;printf("t姓名t工号t进场时间t职称t部门t工资");for(i=0;i4、,w[i].name,w[i].number,w[i].y,w[i].m,w[i].d,w[i].zhicheng,w[i].bumen,w[i].salary);}}/*******3.1查询姓名**********/voidSearchName(Workerw[],intn){charname[20];inti;printf("ttt输入要查询的名字:");scanf("%s",name);for(i=0;i5、ttt查得信息如下:");printf("姓名t工号t进场时间t职称t部门t工资");printf("%st%ldt%d-%d-%dt%st%st%f",w[i].name,w[i].number,w[i].y,w[i].m,w[i].d,w[i].zhicheng,w[i].bumen,w[i].salary);return;}}printf("ttt查无此人!");}/*******3.2查询工号**********/voidSearchNumber(Wor
6、kerw[],intn){longnumber;inti,k=0;printf("ttt输入要查询的工号:");scanf("%ld",&number);for(i=0;i7、y,w[i].m,w[i].d,w[i].zhicheng,w[i].bumen,w[i].salary);return;}}printf("ttt查无此人!");}/*******3.查询**********/voidSearch(Workerw[],intn){intx;printf("ttt选择查询方式(1.姓名/2.工号):");scanf("%d",&x);printf("");switch(x){case1:SearchName(w,n);break;case2:SearchNumb
8、er(w,n);break;}}/*******4.删除**********/voidDelete(Workerw[],intn){charname[20];inti,j;printf("ttt输入要删除的名字:");scanf("%s",name);printf("");for(i=0;i