|
|
|
@ -47,6 +47,7 @@ void load()//¼
|
|
|
|
|
printf("按回车返回菜单");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
getchar();
|
|
|
|
|
mune();
|
|
|
|
|
}
|
|
|
|
|
void find()//寻找
|
|
|
|
|
{ int i;
|
|
|
|
@ -69,10 +70,11 @@ void find()//Ѱ
|
|
|
|
|
printf("按回车返回菜单");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
getchar();
|
|
|
|
|
mune();
|
|
|
|
|
}
|
|
|
|
|
void add()//添加
|
|
|
|
|
{int i;
|
|
|
|
|
printf("请输入要添加人的信息\n\t\t\姓名\籍贯\手机号1\手机号2\邮件\n");
|
|
|
|
|
printf("请输入要添加人的信息\n\t\t/姓名/籍贯/手机号1/手机号2/邮件\n");
|
|
|
|
|
scanf("%s%s%s%s%s",m[k].name,m[k].jiguan,m[k].handset,m[k].handset2,m[k].email);
|
|
|
|
|
k++;
|
|
|
|
|
m[k-1].num=k;
|
|
|
|
@ -80,11 +82,11 @@ void add()//
|
|
|
|
|
scanf("%d",&i);
|
|
|
|
|
if(i==1)
|
|
|
|
|
add();
|
|
|
|
|
|
|
|
|
|
mune();
|
|
|
|
|
}
|
|
|
|
|
void change()
|
|
|
|
|
{
|
|
|
|
|
char sr;
|
|
|
|
|
char c;
|
|
|
|
|
int i;
|
|
|
|
|
printf("请输入要修改人的名字\n");
|
|
|
|
|
scanf("%s",n);
|
|
|
|
@ -93,13 +95,14 @@ void change()
|
|
|
|
|
if(strcmp(m[i].name,n)==0)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
printf("%d",i);
|
|
|
|
|
if(i>15)
|
|
|
|
|
if(i>=15)
|
|
|
|
|
{
|
|
|
|
|
printf("无此人,请重输\n");
|
|
|
|
|
change();
|
|
|
|
|
getchar();
|
|
|
|
|
}
|
|
|
|
|
printf("%d\t%s\t%s\t%s\n%s\t%s\n",m[i].num,m[i].name,m[i].jiguan,m[i].handset,m[i].handset2,m[i].email);
|
|
|
|
|
printf("序号\t名字\t籍贯\t手机1\t手机2\t电子邮件\n");
|
|
|
|
|
printf("%d\t%s\t%s\t%s\t%s\t%s\n",m[i].num,m[i].name,m[i].jiguan,m[i].handset,m[i].handset2,m[i].email);
|
|
|
|
|
printf("请输入修改后的信息\n");
|
|
|
|
|
printf("\t-----------确定要修改的信息------------\n");
|
|
|
|
|
printf("\t-----------名字扣1-----------\n");
|
|
|
|
@ -107,21 +110,21 @@ void change()
|
|
|
|
|
printf("\t----------电话扣3----------\n");
|
|
|
|
|
printf("\t-----------电子邮件扣4-----------\n");
|
|
|
|
|
printf("\t--------------全部扣0------------\n");
|
|
|
|
|
scanf("%c",&sr);
|
|
|
|
|
do{
|
|
|
|
|
switch(sr)
|
|
|
|
|
{
|
|
|
|
|
case '1':scanf("%s",m[i].name);break;
|
|
|
|
|
case '2':scanf("%s",m[i].jiguan);break;
|
|
|
|
|
case '3':scanf("%s%s",m[i].handset,m[i].handset2);break;
|
|
|
|
|
case '4':scanf("%s",m[i].email);break;
|
|
|
|
|
case '0':scanf("%d%s%s%s%s%s",&m[i].num,m[i].name,m[i].jiguan,m[i].handset,m[i].email);break;
|
|
|
|
|
default:printf("输入错误");
|
|
|
|
|
}
|
|
|
|
|
}while(!(sr==1||sr==2||sr==3||sr==4));
|
|
|
|
|
printf("按回车返回菜单");
|
|
|
|
|
getchar();
|
|
|
|
|
scanf("%c",&c);
|
|
|
|
|
switch(c)
|
|
|
|
|
{
|
|
|
|
|
case '1': printf("请输入姓名\n");scanf("%s",m[i].name);break;
|
|
|
|
|
case '2':printf("请输入籍贯\n");scanf("%s",m[i].jiguan);break;
|
|
|
|
|
case '3':printf("请输入电话1、2\n");scanf("%s%s",m[i].handset,m[i].handset2);break;
|
|
|
|
|
case '4':printf("请输入电子邮件\n");scanf("%s",m[i].email);break;
|
|
|
|
|
case '0':printf("请输入姓名、籍贯、电话1、2、电子邮件\n");scanf("%s%s%s%s%s",m[i].name,m[i].jiguan,m[i].handset,m[i].handset2,m[i].email);break;
|
|
|
|
|
default:printf("!!!!!!!!输入错误\n");
|
|
|
|
|
}
|
|
|
|
|
printf("按回车返回主页");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
getchar();
|
|
|
|
|
mune();
|
|
|
|
|
}
|
|
|
|
|
void see()
|
|
|
|
|
{ int i;
|
|
|
|
@ -133,7 +136,7 @@ void see()
|
|
|
|
|
printf("按回车键返回主页");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
getchar();
|
|
|
|
|
return;
|
|
|
|
|
mune();
|
|
|
|
|
}
|
|
|
|
|
void mune()//菜单
|
|
|
|
|
{
|
|
|
|
@ -149,12 +152,12 @@ void mune()//
|
|
|
|
|
printf("\t----------保存扣6----------\n");
|
|
|
|
|
printf("\t--------------退出扣0------------\n");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
printf("序号\t名字\t籍贯\t手机1\t手机2\t电子邮件\n");
|
|
|
|
|
for(i=0;i<k;i++)
|
|
|
|
|
{
|
|
|
|
|
printf("%d\t%s\t%s\t%s\t%s\t%s\n",m[i].num,m[i].name,m[i].jiguan,m[i].handset,m[i].handset2,m[i].email);
|
|
|
|
|
}
|
|
|
|
|
scanf("%c",&c);
|
|
|
|
|
|
|
|
|
|
switch(c)
|
|
|
|
|
{
|
|
|
|
|
case '1':system("color 2E");
|
|
|
|
@ -162,13 +165,12 @@ void mune()//
|
|
|
|
|
case '2':see();break;
|
|
|
|
|
case '3':find();break;
|
|
|
|
|
case '4':change();break;
|
|
|
|
|
case '5':add();mune();break;
|
|
|
|
|
case '5':add();break;
|
|
|
|
|
case '6':save();break;
|
|
|
|
|
case '0':exit(0);
|
|
|
|
|
default:printf("!!!!!!!!输入错误,按回车重输\n");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
getchar();
|
|
|
|
|
mune();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int main(void)
|
|
|
|
@ -200,7 +202,6 @@ int main(void)
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
getchar();
|
|
|
|
|
mune();
|
|
|
|
|
main();
|
|
|
|
|
}
|
|
|
|
|
void save()
|
|
|
|
|
{
|
|
|
|
@ -208,5 +209,5 @@ int main(void)
|
|
|
|
|
rewind(fp);
|
|
|
|
|
for(i=0;i<k;i++)
|
|
|
|
|
fprintf(fp,"\n%d\t%s\t%s\t%s\t%s\t%s",m[i].num,m[i].name,m[i].jiguan,m[i].handset,m[i].handset2,m[i].email);
|
|
|
|
|
main();
|
|
|
|
|
mune();
|
|
|
|
|
}
|