diff --git a/421.c b/464.c similarity index 91% rename from 421.c rename to 464.c index f228e65..9add91c 100644 --- a/421.c +++ b/464.c @@ -47,7 +47,7 @@ void main() break; case 5:b=shanchu(p); break; - case 6:printf("感谢您的使用"); + case 6:printf("感谢您的使用!"); break; default:printf("请输入正确的序号:\n"); break; @@ -118,7 +118,7 @@ void liulan(FILE *p) } void chaxun(FILE *p) { - int i=0; + int xuhao1=0; p=fopen("txl.sto","rb+"); if(p==NULL) { @@ -137,12 +137,12 @@ void chaxun(FILE *p) { printf("姓名: 籍贯: 电话号码1: 电话号码2: 邮箱:\n"); printf("%s %s %lld %lld %s\n",lxr.name,lxr.jiguan,lxr.num1,lxr.num2,lxr.email); - i=i+1; + xuhao1=xuhao1+1; } fread(&lxr,sizeof(lxr),1,p); } - if(i==count&&(strcmp(mingzi,lxr.name)!=0)) + if(xuhao1==count&&(strcmp(mingzi,lxr.name)!=0)) printf("无该联系人\n"); fclose(p); } @@ -175,10 +175,10 @@ void xiugai(FILE *p) printf("6.取消\n"); while(next=='Y') { - int c; + int xuhao; printf("请输入序号:"); - scanf("%d",&c); - switch(c) + scanf("%d",&xuhao); + switch(xuhao) { case 1:printf("请修改姓名:"); scanf("%s",lxr.name); @@ -187,15 +187,17 @@ void xiugai(FILE *p) scanf("%s",lxr.jiguan); break; case 3:printf("请修改电话号码1:"); - scanf("%s",lxr.num1); + scanf("%lld",&lxr.num1); break; case 4:printf("请修改电话号码2:"); - scanf("%s",lxr.num2); + scanf("%lld",&lxr.num2); break; case 5:printf("请修改邮箱:"); scanf("%s",lxr.email); break; - default:printf("输入错误"); + case 6:break; + + default:printf("输入错误\n"); break; } printf("继续修改:Y\n停止修改:其他字母\n"); @@ -223,6 +225,7 @@ int shanchu(FILE *p) { printf("通讯录为空,请建立新联系人!\n"); fclose(p); + getchar(); return 0; } else @@ -230,7 +233,7 @@ int shanchu(FILE *p) person b; person blank={}; char name[20]; - int c=0; + int jishu=0; rewind(p); printf("请输入您要删除的联系人名称:"); scanf("%s",name); @@ -244,12 +247,12 @@ int shanchu(FILE *p) fwrite(&blank,sizeof(blank),1,p); printf("删除成功!\n"); fclose(p); - c=c+1; + jishu=jishu+1; return 0; } } - if(c==count&&(strcmp(name,b.name)!=0)) + if(jishu==count&&(strcmp(name,b.name)!=0)) printf("无该联系人!\n"); fclose(p); return 0; diff --git a/421.exe b/464.exe similarity index 63% rename from 421.exe rename to 464.exe index 92eebac..d34d819 100644 Binary files a/421.exe and b/464.exe differ diff --git a/421.o b/464.o similarity index 62% rename from 421.o rename to 464.o index 64fd3fc..1bf5e07 100644 Binary files a/421.o and b/464.o differ