|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include<stdlib.h>
|
|
|
|
|
#include<conio.h>
|
|
|
|
|
void add();
|
|
|
|
|
void change();
|
|
|
|
|
void find();
|
|
|
|
|
void ioad();
|
|
|
|
|
void mune();
|
|
|
|
|
void see();
|
|
|
|
|
void save();
|
|
|
|
|
char n[30];
|
|
|
|
|
int k=0;
|
|
|
|
|
FILE *fp;
|
|
|
|
|
struct tong
|
|
|
|
|
{ int num;
|
|
|
|
|
char name[30]; //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
char jiguan[30]; //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
char handset[30]; //<2F>ֻ<EFBFBD>
|
|
|
|
|
char handset2[30];
|
|
|
|
|
char email[30]; //<2F><><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>
|
|
|
|
|
}m[15]={0};
|
|
|
|
|
void load()//¼<><C2BC>
|
|
|
|
|
{ int i;
|
|
|
|
|
char s[100];
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",s);
|
|
|
|
|
fp=fopen(s,"r+");
|
|
|
|
|
if(fp==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("open error\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
load();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
printf("¼<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>\n");
|
|
|
|
|
|
|
|
|
|
for(i=0;i<15;i++)
|
|
|
|
|
{
|
|
|
|
|
fscanf(fp,"%d%s%s%s%s%s",&m[i].num,m[i].name,m[i].jiguan,m[i].handset,m[i].handset2,m[i].email);
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD>ֻ<EFBFBD>1\t<EFBFBD>ֻ<EFBFBD>2\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>\n");
|
|
|
|
|
for(i=0;i<15;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);
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>س<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ز˵<EFBFBD>");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
getchar();
|
|
|
|
|
mune();
|
|
|
|
|
}
|
|
|
|
|
void find()//Ѱ<><D1B0>
|
|
|
|
|
{ int i;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҪѰ<EFBFBD>ҵ<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
scanf("%s",n);
|
|
|
|
|
for(i=0;i<15;i++)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(m[i].name,n)==0)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if(i>15)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
getchar();
|
|
|
|
|
find();
|
|
|
|
|
}
|
|
|
|
|
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("<EFBFBD><EFBFBD><EFBFBD>س<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ز˵<EFBFBD>");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
getchar();
|
|
|
|
|
mune();
|
|
|
|
|
}
|
|
|
|
|
void add()//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
{int i;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>Ϣ\n\t\t/<2F><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>/<2F>ֻ<EFBFBD><D6BB><EFBFBD>1/<2F>ֻ<EFBFBD><D6BB><EFBFBD>2/<2F>ʼ<EFBFBD>\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;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӻس<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ز˵<EFBFBD>");
|
|
|
|
|
scanf("%d",&i);
|
|
|
|
|
if(i==1)
|
|
|
|
|
add();
|
|
|
|
|
mune();
|
|
|
|
|
}
|
|
|
|
|
void change()
|
|
|
|
|
{
|
|
|
|
|
char c;
|
|
|
|
|
int i;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",n);
|
|
|
|
|
for(i=0;i<15;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(m[i].name,n)==0)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if(i>=15)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
change();
|
|
|
|
|
getchar();
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD>ֻ<EFBFBD>1\t<EFBFBD>ֻ<EFBFBD>2\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>\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("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
|
|
|
|
|
printf("\t-----------ȷ<><C8B7>Ҫ<EFBFBD>ĵ<DEB8><C4B5><EFBFBD>Ϣ------------\n");
|
|
|
|
|
printf("\t-----------<2D><><EFBFBD>ֿ<EFBFBD>1-----------\n");
|
|
|
|
|
printf("\t-----------<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2-----------\n");
|
|
|
|
|
printf("\t----------<2D>绰<EFBFBD><E7BBB0>3----------\n");
|
|
|
|
|
printf("\t-----------<2D><><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>4-----------\n");
|
|
|
|
|
printf("\t--------------ȫ<><C8AB><EFBFBD><EFBFBD>0------------\n");
|
|
|
|
|
getchar();
|
|
|
|
|
scanf("%c",&c);
|
|
|
|
|
switch(c)
|
|
|
|
|
{
|
|
|
|
|
case '1': printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");scanf("%s",m[i].name);break;
|
|
|
|
|
case '2':printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뼮<EFBFBD><EFBFBD>\n");scanf("%s",m[i].jiguan);break;
|
|
|
|
|
case '3':printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>绰1<EFBFBD><EFBFBD>2\n");scanf("%s%s",m[i].handset,m[i].handset2);break;
|
|
|
|
|
case '4':printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>\n");scanf("%s",m[i].email);break;
|
|
|
|
|
case '0':printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᡢ<EFBFBD>绰1<EFBFBD><EFBFBD>2<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>\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("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>س<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
getchar();
|
|
|
|
|
mune();
|
|
|
|
|
}
|
|
|
|
|
void see()
|
|
|
|
|
{ int i;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD>ֻ<EFBFBD>1\t<EFBFBD>ֻ<EFBFBD>2\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>\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);
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>س<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
getchar();
|
|
|
|
|
mune();
|
|
|
|
|
}
|
|
|
|
|
void mune()//<2F>˵<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
char c;
|
|
|
|
|
int i;
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\t-----------ͨѶ¼<D1B6><C2BC><EFBFBD><EFBFBD>------------\n");
|
|
|
|
|
printf("\t-----------<2D>ļ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>1-----------\n");
|
|
|
|
|
printf("\t-----------<2D><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2-----------\n");
|
|
|
|
|
printf("\t----------<2D><>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3----------\n");
|
|
|
|
|
printf("\t-----------<2D><>Ϣ<EFBFBD>Ŀ<DEB8>4-----------\n");
|
|
|
|
|
printf("\t------------<2D><><EFBFBD>ӿ<EFBFBD>5------------\n");
|
|
|
|
|
printf("\t----------<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>6----------\n");
|
|
|
|
|
printf("\t--------------<2D>˳<EFBFBD><CBB3><EFBFBD>0------------\n");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD>ֻ<EFBFBD>1\t<EFBFBD>ֻ<EFBFBD>2\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>\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");
|
|
|
|
|
load();break;
|
|
|
|
|
case '2':see();break;
|
|
|
|
|
case '3':find();break;
|
|
|
|
|
case '4':change();break;
|
|
|
|
|
case '5':add();break;
|
|
|
|
|
case '6':save();break;
|
|
|
|
|
case '0':exit(0);
|
|
|
|
|
default:printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
getchar();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int main(void)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 3E");
|
|
|
|
|
fp=fopen("ͨѶ¼2.txt","r+");
|
|
|
|
|
if(fp==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("ͨѶ¼<EFBFBD>ļ<EFBFBD>¼<EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>\n");
|
|
|
|
|
load();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
printf("ͨѶ¼¼<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
k=0;
|
|
|
|
|
for(i=0;i<15;i++)
|
|
|
|
|
{
|
|
|
|
|
fscanf(fp,"%d%s%s%s%s%s",&m[i].num,m[i].name,m[i].jiguan,m[i].handset,m[i].handset2,m[i].email);
|
|
|
|
|
if((m[i].num)!=0)
|
|
|
|
|
k++;
|
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>س<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
getchar();
|
|
|
|
|
mune();
|
|
|
|
|
}
|
|
|
|
|
void save()
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
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);
|
|
|
|
|
mune();
|
|
|
|
|
}
|