commit 230cfbcf892e39191c3f8f86b56c316aaca14e8d Author: 缃椾竵 <18408000217@stu.hut.edu.cn> Date: Fri Jan 4 21:13:12 2019 +0800 first commit diff --git a/main.c b/main.c new file mode 100644 index 0000000..50baf3a --- /dev/null +++ b/main.c @@ -0,0 +1,202 @@ +#include +#include +#include +int i=1; +struct staffsinfor +{ + char staffnums[100]; + char name[100]; + char sex[100]; + char studyF[100]; + char homedress[100]; + char money[100]; + char phonenum[100]; +}; +void input(struct staffsinfor staffs[]){ + int j; + two :system("cls"); + printf("\t\t\t\t您在进行的是信息录入!\t\t\t已有人数%d(最多50人)\n\n\n",i); + if(i==50) + { + MessageBox(NULL,"人数已满!","系统提示",MB_OK); + return 0; + } + printf("\t\t\t请输入姓名\n"); + gets(staffs[i].name); + printf("\t\t\t请输入职工号\n"); + gets(staffs[i].staffnums); + printf("\t\t\t请输入性别\n"); + gets(staffs[i].sex); + printf("\t\t\t请输入学历\n"); + gets(staffs[i].studyF); + printf("\t\t\t亲输入工资\n"); + gets(staffs[i].money); + printf("\t\t\t请输入住址\n"); + gets(staffs[i].homedress); + printf("\t\t\t请输入电话\n"); + gets(staffs[i].phonenum); + j=MessageBox(NULL,"是否确定?","系统提示",MB_YESNO); + if(j==6) + { + MessageBox(NULL,"录入成功","系统提示",MB_OK); + i++; + j=MessageBox(NULL,"是否继续录入?","系统提示",MB_YESNO); + if(j==6) + goto two; + + + + } + else + { + MessageBox(NULL,"请重新录入","系统提示",MB_OK); + goto two; + } +} +void look(struct staffsinfor staffs[]){ + int j=i;j--;char o; + three : + system("cls"); + printf("\t\t\t\t您在进行的是浏览名单!\n\n\n"); + if(j==0) + { + MessageBox(NULL,"未找到名单信息!","系统提示",MB_OK); + return 0; + } + printf("\t\t\t姓名:\n\t\t\t\t\t\t\t%s",staffs[j].name); + printf("\n\t\t\t职工号:\n\t\t\t\t\t\t\t%s",staffs[j].staffnums); + printf("\n\t\t\t性别:\n\t\t\t\t\t\t\t%s",staffs[j].sex); + printf("\n\t\t\t学历:\n\t\t\t\t\t\t\t%s",staffs[j].studyF); + printf("\n\t\t\t工资:\n\t\t\t\t\t\t\t%s",staffs[j].money); + printf("\n\t\t\t家庭住址:\n\t\t\t\t\t\t\t%s",staffs[j].homedress); + printf("\n\t\t\t电话号码:\n\t\t\t\t\t\t\t%s",staffs[j].phonenum); + printf("\n\n\n\t\t\t\t\t\t按A和D切换名单\n\t\t\t\t\t\t按BackSpace退回菜单"); + o=getch(); + if(o=='A') + { + if(j==1) + {system("cls"); + printf("这已经是第一个了"); + system("pause"); + goto three; + } + j--; + goto three; + } + if(o=='D') + { + if(j==i&&j!=i) + {system("cls"); + printf("这是最后一个了"); + system("pause"); + goto three; + } + j++; + goto three; + } + if(o==8) + return 0; + + +} +void cha(struct staffsinfor staffs[]){ + char a;char name[100];int o; + system("cls"); + printf("\t\t\t\t管理菜单\t\t\t\t\n"); + printf("**********************************************************************\n\n\n"); + printf("\t\t\t\tA.按职工好查询\t\t\t\t\n\n"); + printf("\t\t\t\tB.按姓名查询\t\t\t\t\n\n"); + printf("\t\t\t\t\t\t\t\t\n\n"); + printf("\t\t\t\t\t按BackSpace返回上一页\n\n\n\n\n"); + printf("**********************************************************************\n"); + a=getch(); + if(a=='A') + { + four : + system("cls"); + printf("\t\t\t\t您在进行的是信息录入!\t\t\t\n\n\n"); + printf("请输入职员职工号\n"); + gets(name); + for(o=0;o