|
|
|
|
#include<stdio.h>
|
|
|
|
|
#include<stdlib.h>
|
|
|
|
|
#include<string.h>
|
|
|
|
|
#include<conio.h>//Ϊ<><CEAA>ʹ<EFBFBD><CAB9>gitch<63><68><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD>ͷ<EFBFBD>ļ<EFBFBD>
|
|
|
|
|
#define Bytes sizeof(struct linkman) //<2F>궨<EFBFBD><EAB6A8><EFBFBD>ṹ<EFBFBD><E1B9B9><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>д
|
|
|
|
|
#define FORMAT "\t%-10s%-10s%-15s%-15s%-20s\n\n" //<2F>궨<EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
|
|
|
|
|
#define DATA peo[i].name,peo[i].birthplace,peo[i].tel_1,peo[i].tel_2,peo[i].email //<2F>궨<EFBFBD><EAB6A8><EFBFBD>ṹ<EFBFBD><E1B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|
|
|
|
struct linkman //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˽ṹ<CBBD><E1B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
char name[10];//<2F><>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
char birthplace[10];//<2F><>ϵ<EFBFBD>˼<EFBFBD><CBBC><EFBFBD>
|
|
|
|
|
char tel_1[15];//<2F><>ϵ<EFBFBD>˵ĵ绰<C4B5><E7BBB0><EFBFBD><EFBFBD>1
|
|
|
|
|
char tel_2[15];//<2F><>ϵ<EFBFBD>˵ĵ绰<C4B5><E7BBB0><EFBFBD><EFBFBD>2
|
|
|
|
|
char email[20];//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
|
|
};
|
|
|
|
|
struct linkman peo[100];//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void addman();
|
|
|
|
|
void queryman();
|
|
|
|
|
void delman();
|
|
|
|
|
void update();
|
|
|
|
|
void outputman();
|
|
|
|
|
void menu();
|
|
|
|
|
|
|
|
|
|
void menu()//<2F>˵<EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
{
|
|
|
|
|
system("cls");//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
printf("\n\t\t**********ͨѶ¼<D1B6><C2BC><EFBFBD><EFBFBD>ϵͳ*********\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD>-------------------------------<2D><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 1.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5> <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 2.<2E><>ѯ<EFBFBD><D1AF>ϵ<EFBFBD><CFB5> <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 3.ɾ<><C9BE><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5> <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 4.<2E><EFBFBD><DEB8><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ϣ <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 5.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>б<EFBFBD> <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 0.<2E>˳<EFBFBD> <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD>-------------------------------<2D><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(0-5):");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void tou() //<2F><>ϵ<EFBFBD><CFB5><EFBFBD>б<EFBFBD>ͷ<EFBFBD><CDB7>ͼ<EFBFBD><CDBC>
|
|
|
|
|
{ system("cls");
|
|
|
|
|
printf("\n");
|
|
|
|
|
printf("*************************************<2A><>ϵ<EFBFBD><CFB5><EFBFBD>б<EFBFBD>***************************************\n\n");
|
|
|
|
|
printf("\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t <20><><EFBFBD><EFBFBD>\t <20>绰<EFBFBD><E7BBB0><EFBFBD><EFBFBD>1\t <20>绰<EFBFBD><E7BBB0><EFBFBD><EFBFBD>2\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\n");
|
|
|
|
|
}
|
|
|
|
|
void wei() //<2F><>ϵ<EFBFBD><CFB5><EFBFBD>б<EFBFBD>β<EFBFBD><CEB2>ͼ<EFBFBD><CDBC>
|
|
|
|
|
{
|
|
|
|
|
printf("\n**************************************************************************************\n\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main ()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
system("mode con: cols=86 lines=30");//<2F><><EFBFBD>ô<EFBFBD><C3B4>ڴ<EFBFBD>С
|
|
|
|
|
int n;
|
|
|
|
|
menu();//<2F><><EFBFBD>ò˵<C3B2><CBB5><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
scanf("%d",&n);//<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
while(n)//<2F><>n=0ʱ<30>˳<EFBFBD><CBB3>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
switch(n)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
addman();//<2F><>n=1ʱ<31><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ģ<EFBFBD><C4A3>
|
|
|
|
|
getch();
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
queryman();//<2F><>n=1ʱ<31><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ģ<EFBFBD><C4A3>
|
|
|
|
|
getch();
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
delman();//<2F><>n=1ʱ<31><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ģ<EFBFBD><C4A3>
|
|
|
|
|
getch();
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
update();//<2F><>n=1ʱ<31><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ģ<EFBFBD><C4A3>
|
|
|
|
|
getch();
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
outputman();//<2F><>n=1ʱ<31><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ģ<EFBFBD><C4A3>
|
|
|
|
|
getch();
|
|
|
|
|
break;
|
|
|
|
|
default:break;
|
|
|
|
|
}
|
|
|
|
|
menu();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>break֮<6B><D6AE> <20>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>棬ֱ<E6A3AC><D6B1><EFBFBD>˳<EFBFBD>
|
|
|
|
|
scanf("%d",&n);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void addman()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˺<EFBFBD><CBBA><EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
{
|
|
|
|
|
FILE *p1; //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ָ<EFBFBD><D6B8>
|
|
|
|
|
int i,n,count=0; // countΪ<74><CEAA>ϵ<EFBFBD>˸<EFBFBD><CBB8><EFBFBD>
|
|
|
|
|
if ((p1=fopen("D:\\<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>Ŀ\\linkman.txt","a+"))==NULL) //<2F><><EFBFBD><EFBFBD>linkman<61>ļ<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><EFBFBD>ļ<EFBFBD>");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
while(!feof(p1))//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD>0ֵ<30><D6B5><EFBFBD>ļ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0ֵ<30><D6B5>
|
|
|
|
|
{
|
|
|
|
|
if(fread(&peo[count],Bytes,1,p1)==1) //<2F><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ĩβ <20><><EFBFBD><EFBFBD> 0
|
|
|
|
|
count++; //<2F><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>ȡ<EFBFBD><C8A1> һ<><D2BB> count<6E>ͼ<EFBFBD>һ
|
|
|
|
|
}
|
|
|
|
|
fclose(p1); //<2F>ر<EFBFBD><D8B1>ļ<EFBFBD>
|
|
|
|
|
if(count==0)
|
|
|
|
|
printf("\n\t<EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>Ϊ<EFBFBD><EFBFBD>!\n\n");
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
system("cls"); //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
outputman();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD>飬<EFBFBD><E9A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>Ϣ
|
|
|
|
|
}
|
|
|
|
|
if ((p1=fopen("D:\\<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>Ŀ\\linkman.txt","wb"))==NULL)//<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>Ʒ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>linkman<61>ļ<EFBFBD> <20><><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>д<EFBFBD><D0B4><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
printf("\t<EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
printf("\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>ˣ<EFBFBD>1 or 0):");
|
|
|
|
|
scanf("%d",&n);
|
|
|
|
|
while(n==1)
|
|
|
|
|
{
|
|
|
|
|
printf("\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ:\n\n");
|
|
|
|
|
printf("\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
scanf("%s",&peo[count].name);
|
|
|
|
|
for(i=0;i<count;i++)//<2F><><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD>жϸ<D0B6><CFB8><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(peo[i].name,peo[count].name)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><EFBFBD>ڣ<EFBFBD>\n");
|
|
|
|
|
getch();
|
|
|
|
|
fclose(p1); //<2F>ر<EFBFBD><D8B1>ļ<EFBFBD>
|
|
|
|
|
return; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printf("\n\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: "); //<2F><><EFBFBD>뼮<EFBFBD><EBBCAE>
|
|
|
|
|
scanf("%s",&peo[count].birthplace);
|
|
|
|
|
printf("\n\t<EFBFBD>绰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>1: "); //<2F><><EFBFBD><EFBFBD>number1
|
|
|
|
|
scanf("%s",&peo[count].tel_1);
|
|
|
|
|
printf("\n\t<EFBFBD>绰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>2: "); //<2F><><EFBFBD><EFBFBD>number2
|
|
|
|
|
scanf("%s",&peo[count].tel_2);
|
|
|
|
|
printf("\n\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: "); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
scanf("%s",&peo[count].email);
|
|
|
|
|
printf("\n\t%s <20><><EFBFBD>ӳɹ<D3B3>!\n",peo[count].name);
|
|
|
|
|
count++; //<2F><>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF>һ
|
|
|
|
|
n=0;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϻ<EFBFBD><CFBA>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˹<EFBFBD><CBB9><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
for(i=0;i<count;i++) fwrite(&peo[i],Bytes,1,p1);//ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD><C8AB>д<EFBFBD><D0B4><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
fclose(p1);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void queryman()//<2F><>ѯ<EFBFBD><D1AF>ϵ<EFBFBD>˺<EFBFBD><CBBA><EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
{
|
|
|
|
|
FILE *p1;
|
|
|
|
|
int i,n=1,m,count=0,flag=1;
|
|
|
|
|
|
|
|
|
|
if ((p1=fopen("D:\\<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>Ŀ\\linkman.txt","rb"))==NULL)//<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>Ʒ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>linkman<61>ļ<EFBFBD>
|
|
|
|
|
exit(0);
|
|
|
|
|
while(!feof(p1))//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD>0ֵ<30><D6B5><EFBFBD>ļ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0ֵ<30><D6B5>
|
|
|
|
|
if(fread(&peo[count],Bytes,1,p1)) //<2F><><EFBFBD>ļ<EFBFBD><C4BC>е<EFBFBD><D0B5><EFBFBD><EFBFBD>ݶ<EFBFBD><DDB6><EFBFBD><EFBFBD>ṹ<EFBFBD><E1B9B9><EFBFBD><EFBFBD>
|
|
|
|
|
count++;//<2F><>ȡ<EFBFBD>ɹ<EFBFBD>һ<EFBFBD><D2BB> <20><>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ
|
|
|
|
|
fclose(p1); //<2F><>ȡ<EFBFBD><C8A1><EFBFBD>ر<EFBFBD><D8B1>ļ<EFBFBD>
|
|
|
|
|
|
|
|
|
|
if(count==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>\n");
|
|
|
|
|
printf("<EFBFBD>밴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
while(n)// n<><6E><EFBFBD><EFBFBD>Ϊ<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ȳ<EFBFBD>ʼ<EFBFBD><CABC>n=1
|
|
|
|
|
{
|
|
|
|
|
outputman();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>б<EFBFBD>
|
|
|
|
|
while(flag!=0)//flagΪ<67>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ <20><>ѡ<EFBFBD><EFBFBD>ʱ <20><>flag=0<><30><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>ѯ<EFBFBD><D1AF>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>
|
|
|
|
|
{ system("cls");//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
printf("\n\t\t**********<2A><>ѯ<EFBFBD><D1AF>ʽ***********\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD>-------------------------------<2D><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 1.<2E><><EFBFBD><EFBFBD> <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 2.<2E><><EFBFBD><EFBFBD> <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 3.<2E>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD>1 <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 4.<2E><><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD>2 <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 5.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 0.<2E><><EFBFBD><EFBFBD> <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD>-------------------------------<2D><>\n");
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD>ʽ:");
|
|
|
|
|
scanf("\t\t%d",&m);//ѡ<><D1A1><EFBFBD><EFBFBD>ѯʽ
|
|
|
|
|
|
|
|
|
|
if(m==1)//<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
char name[15];
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>");
|
|
|
|
|
scanf("%s",name);
|
|
|
|
|
for(i=0;i<=count;++i)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(name,peo[i].name)==0)
|
|
|
|
|
{ tou();
|
|
|
|
|
printf(FORMAT,DATA);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>
|
|
|
|
|
getch(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
if(count==i)//<2F><>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ʱ<EFBFBD><CAB1>û<EFBFBD><C3BB><EFBFBD>ҵ<EFBFBD>Ҫ<EFBFBD><D2AA>ѯ<EFBFBD><D1AF><EFBFBD>ˣ<EFBFBD>ִ<EFBFBD>и<EFBFBD>if<69><66><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˲<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>\n\t\t\t<EFBFBD>밴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(m==2)//<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
char bp[15];
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뼮<EFBFBD>");
|
|
|
|
|
scanf("%s",bp);
|
|
|
|
|
for(i=0;i<=count;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(bp,peo[i].birthplace)==0)
|
|
|
|
|
{ tou();
|
|
|
|
|
printf(FORMAT,DATA);
|
|
|
|
|
}
|
|
|
|
|
if(count==i)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˲<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>\n\t\t\t<EFBFBD>밴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(m==3)//<2F><>ѯ<EFBFBD>绰<EFBFBD><E7BBB0><EFBFBD><EFBFBD>һ
|
|
|
|
|
{
|
|
|
|
|
char num1[15];
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>绰<EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
scanf("%s",num1);
|
|
|
|
|
for(i=0;i<=count;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(num1,peo[i].tel_1)==0)
|
|
|
|
|
{ tou();
|
|
|
|
|
printf(FORMAT,DATA);
|
|
|
|
|
}
|
|
|
|
|
if(count==i)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˲<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>\n\t\t\t<EFBFBD>밴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(m==4)//<2F><>ѯ<EFBFBD>绰<EFBFBD><E7BBB0><EFBFBD><EFBFBD>2
|
|
|
|
|
{
|
|
|
|
|
char num2[15];
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>绰<EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
scanf("%s",num2);
|
|
|
|
|
for(i=0;i<=count;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(num2,peo[i].tel_2)==0)
|
|
|
|
|
{ tou();
|
|
|
|
|
printf(FORMAT,DATA);
|
|
|
|
|
}
|
|
|
|
|
if(count==i)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˲<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>\n\t\t\t<EFBFBD>밴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(m==5)//<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
char mail[20];
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",mail);
|
|
|
|
|
for(i=0;i<=count;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(mail,peo[i].email)==0)
|
|
|
|
|
{ tou();
|
|
|
|
|
printf(FORMAT,DATA);
|
|
|
|
|
}
|
|
|
|
|
if(count==i)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˲<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>\n\t\t\t<EFBFBD>밴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(m==0) //ѡ<><EFBFBD>ʱ
|
|
|
|
|
{
|
|
|
|
|
flag=0;//<2F>˳<EFBFBD><CBB3><EFBFBD>ѯ<EFBFBD><D1AF>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>
|
|
|
|
|
n=0;//<2F>˳<EFBFBD><CBB3><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void update() //<2F><EFBFBD><DEB8><EFBFBD>ϵ<EFBFBD>˺<EFBFBD><CBBA><EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
{
|
|
|
|
|
FILE *p1;//<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ָ<EFBFBD><D6B8>
|
|
|
|
|
int i,m,n;
|
|
|
|
|
int flag=1,count=0,j=1;
|
|
|
|
|
char name[15];
|
|
|
|
|
if ((p1=fopen("D:\\<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>Ŀ\\linkman.txt","r+"))==NULL)//<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>Ʒ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>linkman<61>ļ<EFBFBD>
|
|
|
|
|
exit(0);
|
|
|
|
|
while(!feof(p1))//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD>0ֵ<30><D6B5><EFBFBD>ļ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0ֵ<30><D6B5>
|
|
|
|
|
if(fread(&peo[count],Bytes,1,p1)==1) //<2F><><EFBFBD>ļ<EFBFBD><C4BC>е<EFBFBD><D0B5><EFBFBD><EFBFBD>ݶ<EFBFBD><DDB6><EFBFBD><EFBFBD>ṹ<EFBFBD><E1B9B9><EFBFBD><EFBFBD>
|
|
|
|
|
count++;//ÿ<>ɹ<EFBFBD><C9B9><EFBFBD>ȡһ<C8A1><D2BB><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ
|
|
|
|
|
fclose(p1); //<2F>ر<EFBFBD><D8B1>ļ<EFBFBD>
|
|
|
|
|
if(count==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>Ϊ<EFBFBD><EFBFBD>!\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
while(j==1)//j<><6A><EFBFBD><EFBFBD>Ϊ<EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<DEB8><C4B5>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
outputman();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>б<EFBFBD>
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>");
|
|
|
|
|
scanf("%s",name);
|
|
|
|
|
for(i=0;i<count;++i)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(name,peo[i].name)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD>!\n\n");
|
|
|
|
|
printf("\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD>1 or 0<><30><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%d",&n);
|
|
|
|
|
if(n==0)// n<><6E>Ϊ<EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7>ĵ<DEB8><C4B5>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{ j=0;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľ<DEB8><C4BE>˳<EFBFBD><CBB3>Ĺ<DEB8><C4B9><EFBFBD>
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
while(n==1)
|
|
|
|
|
{
|
|
|
|
|
while(flag==1)//flag<61><67><EFBFBD><EFBFBD>Ϊ<EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
system("cls");//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
printf("\n\t\t************ѡ<><D1A1><EFBFBD><EFBFBD><DEB8><EFBFBD>************\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD>-------------------------------<2D><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 1.<2E><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD> <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 2.<2E>ļ<DEB8><C4BC><EFBFBD> <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 3.<2E><EFBFBD><DEB8>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD>1 <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 4.<2E><><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD>2 <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 5.<2E>ĵ<DEB8><C4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD> 0.<2E><><EFBFBD><EFBFBD> <20><>\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD>-------------------------------<2D><>\n");
|
|
|
|
|
printf("\n\t<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%d",&m);//ѡ<><D1A1><EFBFBD>ķ<DEB8>ʽ
|
|
|
|
|
if(m==1)//<2F><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&peo[i].name);
|
|
|
|
|
printf("\n\t\t<EFBFBD>ijɹ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
if(m==2)//<2F>ļ<DEB8><C4BC><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&peo[i].birthplace);
|
|
|
|
|
printf("\n\n\t\t<EFBFBD>ijɹ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
if(m==3)//<2F>ĵ绰<C4B5><E7BBB0><EFBFBD><EFBFBD>1
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&peo[i].tel_1);
|
|
|
|
|
printf("\n\t\t<EFBFBD>ijɹ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
if(m==4)//<2F>ĵ绰<C4B5><E7BBB0><EFBFBD><EFBFBD>2
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&peo[i].tel_2);
|
|
|
|
|
printf("\n\t\t<EFBFBD>ijɹ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
if(m==5)//<2F><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&peo[i].email);
|
|
|
|
|
printf("\n\t\t<EFBFBD>ijɹ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
if(m==0)
|
|
|
|
|
{
|
|
|
|
|
n=0;//<2F>˳<EFBFBD><CBB3>Ĺ<DEB8><C4B9><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1 or 0<><30><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%d",&flag);
|
|
|
|
|
if(flag==0) n=0,j=0;//<2F>˳<EFBFBD><CBB3>Ĺ<DEB8><C4B9><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if(flag==0)break;
|
|
|
|
|
|
|
|
|
|
if(i==count)// <20><>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ʱ<EFBFBD><CAB1>û<EFBFBD><C3BB><EFBFBD>ҵ<EFBFBD>Ҫ<EFBFBD><D2AA>ѯ<EFBFBD><D1AF><EFBFBD>ˣ<EFBFBD>ִ<EFBFBD>и<EFBFBD>if<69><66><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˲<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>\n\t\t\t<EFBFBD>밴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
getch();
|
|
|
|
|
system("cls");
|
|
|
|
|
outputman;
|
|
|
|
|
}
|
|
|
|
|
}//Ȼ<><C8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>Ҫ<EFBFBD>ĵ<DEB8><C4B5><EFBFBD>
|
|
|
|
|
if((p1=fopen("D:\\<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>Ŀ\\linkman.txt","wb"))==NULL)// ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD><C8AB>д<EFBFBD><D0B4><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
return;
|
|
|
|
|
for(i=0;i<count;i++)
|
|
|
|
|
fwrite(&peo[i],Bytes,1,p1);
|
|
|
|
|
fclose(p1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void delman()
|
|
|
|
|
{
|
|
|
|
|
FILE *p1;
|
|
|
|
|
int i,j,m=1,k=1,count=0;
|
|
|
|
|
char name[15];
|
|
|
|
|
if((p1=fopen("D:\\<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>Ŀ\\linkman.txt","r+"))==NULL) //<2F><>ȡ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>Ϣ
|
|
|
|
|
return;
|
|
|
|
|
while(!feof(p1))
|
|
|
|
|
if(fread(&peo[count],Bytes,1,p1)==1)
|
|
|
|
|
count++;
|
|
|
|
|
fclose(p1);
|
|
|
|
|
if(count==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>Ϊ<EFBFBD><EFBFBD>");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
outputman();
|
|
|
|
|
while(m==1) //mΪ<6D>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{ system("cls");
|
|
|
|
|
outputman();
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>");
|
|
|
|
|
scanf("%s",&name);
|
|
|
|
|
for(i=0;i<=count;++i)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(name,peo[i].name)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t\t<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>ˣ<EFBFBD>\n\n\t\t\t<EFBFBD>Ƿ<EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>0 or 1):");
|
|
|
|
|
scanf("%d",&k);
|
|
|
|
|
if(k==1)//kΪ<6B>Ƿ<EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵<EFBFBD><CBB5>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
for(j=i;j<count;j++)//<2F>Ӵ<EFBFBD><D3B4><EFBFBD>ϵ<EFBFBD>˿<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>ú<EFBFBD>һ<EFBFBD><D2BB><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>Ϣ<EFBFBD>ڸ<EFBFBD>ǰһ<C7B0><D2BB><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>Ϣ
|
|
|
|
|
peo[j]=peo[j+1];
|
|
|
|
|
count--;//<2F><>ϵ<EFBFBD>˼<EFBFBD><CBBC><EFBFBD>һ
|
|
|
|
|
if((p1=fopen("D:\\<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>Ŀ\\linkman.txt","wb"))==NULL)
|
|
|
|
|
return;
|
|
|
|
|
for(j=0;j<count;j++)//<2F><><EFBFBD><EFBFBD>ȫ<EFBFBD><C8AB>д<EFBFBD><D0B4><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
fwrite(&peo[j],Bytes,1,p1);
|
|
|
|
|
fclose(p1);
|
|
|
|
|
printf("\n\t\t\tɾ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
return ;
|
|
|
|
|
}
|
|
|
|
|
if(k==0) break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if(i==count)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˲<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>\n\t\t\t<EFBFBD>밴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
getch();
|
|
|
|
|
system("cls");
|
|
|
|
|
outputman();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void outputman()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˺<EFBFBD><CBBA><EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
{
|
|
|
|
|
FILE *p1;
|
|
|
|
|
int i,count=0;
|
|
|
|
|
if ((p1=fopen("D:\\<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>Ŀ\\linkman.txt","rb"))==NULL)//<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>Ʒ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>linkman<61>ļ<EFBFBD>
|
|
|
|
|
exit(0);
|
|
|
|
|
while(!feof(p1))//<2F>ж<EFBFBD><D0B6>Ƿ<C7B7><F1B5BDB4>ļ<EFBFBD>β<EFBFBD><CEB2>
|
|
|
|
|
if(fread(&peo[count],Bytes,1,p1)==1) //<2F><><EFBFBD>ļ<EFBFBD><C4BC>е<EFBFBD><D0B5><EFBFBD><EFBFBD>ݶ<EFBFBD><DDB6><EFBFBD><EFBFBD>ṹ<EFBFBD><E1B9B9><EFBFBD><EFBFBD>
|
|
|
|
|
count++;
|
|
|
|
|
fclose(p1);
|
|
|
|
|
tou();
|
|
|
|
|
for(i=0;i<count;i++)
|
|
|
|
|
printf(FORMAT,DATA);//<2F><>ȥȫ<C8A5><C8AB><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>
|
|
|
|
|
wei();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|