员工管理系统,做出部分,求大神帮忙修改错误
#include<stdio.h>#include<string.h>
#define N 200
#define LEN sizeof(struct employee)
#define FORMAT "%d %s %s %s %d %s %d %s"
#define DATA em[i].num,em[i].name,em[i].position,em[i].sex,em[i].age,em[i].cult,em[i].salary,em[i].state;
void manage();
void query();
void input();
void display();
void change();
void add();
void del();
void count();
void searchnum();
void searchname();
void manage2();
struct employee
{
int num;
char position[20];
char name[20];
char sex[2];
int age;
char cult[10];
int salary;
char state[8];
}em[N];
struct communication
{
char name[8];
char officete[13];
char hometel[13];
char handtel[13];
char address[13];
}empc[N];
main()
{
char password[7]="123456",s[7];
int flag,n=3,choice;
do
{
printf("请你输入密码:\n");
scanf("%s",s);
if(!strcmp(s,password))
{
printf("恭喜你成功登陆了\n\n\n");
flag=1;
break;
}
else
{
printf("输入错误请重新输入:\n");
n--;
}
}
while(n>0);
{
printf("~~~~~~~~~~~~~~~\t\t\t\t~~~~~~~~~~~~~~~~\n");
printf("\t\t欢迎进入职工管理系统中文版\n");
printf("制作人:\t 班级:\t 学号:\n");
printf("联系地址:\n");
printf("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n");
printf("\t\t请你选择操作类型:\n");
printf("================\t\t\t=================\n");
printf("\t\t1 进入管理系统\n");
printf("\t\t2 进入查询系统\n");
printf("\t\t3 进入通讯录 \n");
printf("\t\t0 退出系统 \n");
printf("================\t\t\t================\n");
printf("说明:版权归作者所有,违者必究\n\n\n\n");
scanf("%d",&choice);
switch(choice)
{
case 1:
{
manage();
break;
}
case 2:
{
query();
break;
}
case 3:
{
communication();
break;
}
case 0:
{
printf("谢谢使用,再见");
exit(0);
}
default:
{
printf("输入有错误,请重新输入:\n");
return (0);
}
}
}
{
FILE*fp;
int i=0;
char choiceinput='y';
if((fp=fopen("employee.txt","a++"))==NULL)
return;
while(choiceinput=='y'||choiceinput=='Y')
{
i++;
printf("第%d个职工\n",i);
printf("\n");
printf("请你输入工号:\n");
scanf("%d",&em[i].num);
printf("\n");
printf("请你输入职位(董事长/总经理/副总经理/经理/副经理/秘书/技术员/领班/员工):\n");
scanf("%s"em[i].positon);
printf("\n");
printf("请你输入姓名:\n");
scanf("%s",em[i].name);
printf("\n");
printf("请你输入性别(男或女):\n");
scanf("%s",em[i].sex);
printf("\n");
printf("请你输入文化程度(专家/博士/硕士/学士/其他)":/n);
scanf("%s",em[i].cult);
printf("\n");
printf("请你输入工资:\n");
scanf("%d",&em[i].salary);
printf("\n");
printf("请你输入身体情况(健康/良好/一般/差):\n");
scanf("%s",em[i].state);
printf("\n");
printf("是否继续输入?(y/n)\n");
scanf("%s",&choiceceinput);
fwrite(&em[i].LEN,1,fp);
}
if(toupper(choiceinput)=='N')
{fclose(fp);
printf("输入完毕,任意键返回\n");
getch;
return;
}
}