You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
a1/完整代码.cpp

823 lines
20 KiB

6 years ago
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
struct record
{
char nativeplace[20];
char name[20];
char phone1[20];
char phone2[20];
char e_mail[30];
}student[500];
int num=0;//<2F>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD>numΪ<6D>ļ<EFBFBD><C4BC>еļ<D0B5>¼<EFBFBD><C2BC>
FILE *fp;
void welcome(); //<2F><>ӭ
void mainmenu(); //<2F><><EFBFBD>˵<EFBFBD>
void newrecord(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼
void modify(); //<2F>޸<EFBFBD><DEB8><EFBFBD>ϵ<EFBFBD><CFB5>
void modifyname(); //<2F><><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>
void modifyphone1(); //<2F><EFBFBD><E7BBB0><EFBFBD><EFBFBD>1<EFBFBD>޸<EFBFBD>
void modifyphone2(); //<2F><EFBFBD><E7BBB0><EFBFBD><EFBFBD>2<EFBFBD>޸<EFBFBD>
void searchmenu(); //<2F><>ѯ<EFBFBD>˵<EFBFBD>
void searchbynativeplace(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ
void searchbyname(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ
void searchbyphone1(); //<2F><><EFBFBD>绰1<E7BBB0><31>ѯ
void searchbyphone2(); //<2F><><EFBFBD>绰2<E7BBB0><32>ѯ
void deletemenu(); //ɾ<><C9BE><EFBFBD>˵<EFBFBD>
void deleteall(); //ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void deleteone(); //ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void showall(); //<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
void readfromfile(); //<2F><>ȡ<EFBFBD>ļ<EFBFBD>
void writetofile(); //д<><D0B4><EFBFBD>ļ<EFBFBD>
void deletebynativeplace(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>
void deletebyname(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>
void listbynativeplace(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void listbyname(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void listmenu(); //<2F><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>
int main() //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
welcome();
readfromfile();
while (1)
{
mainmenu();
}
}
void welcome()//<2F><>ӭ<EFBFBD><D3AD><EFBFBD><EFBFBD>
{
printf("\n\n\n\n\n\n");
printf("\t\t\t============ͨѶ¼<D1B6><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>==============\n");
printf("\n\n\n");
printf("\t\t\t <20><>ӭʹ<D3AD>ã<EFBFBD> \n");
printf("\n\n\n");
printf("\t\t\t===============<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=================\n");
getch();
return;
}
void writetofile()//д<><D0B4><EFBFBD>ļ<EFBFBD>
{
int i;
if ((fp=fopen("student.bin","wb"))==NULL)
{
printf("\n\t\t<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>");
}
for (i=0;i<num;i++)
{
if (fwrite(&student[i],sizeof(struct record),1,fp)!=1)
{
printf("\n\t\tд<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n");
}
}
fclose(fp);
printf("\n\t\tͨѶ¼<EFBFBD>ļ<EFBFBD><EFBFBD>ѱ<EFBFBD><EFBFBD><EFBFBD>");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\t\t");
exit(0);
}
void readfromfile()//<2F><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
{
system("cls");
if((fp=fopen("student.bin","rb"))==NULL)
{
printf("\n\t\tͨѶ¼<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
if ((fp=fopen("student.bin","wb"))==NULL)
{
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>");
exit(0);
}
else
{
printf("\n\t\tͨѶ¼<EFBFBD>ļ<EFBFBD><EFBFBD>ѽ<EFBFBD><EFBFBD><EFBFBD>");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}
exit(0);
}
fseek(fp,0,2); /*<2A>ļ<EFBFBD>λ<EFBFBD><CEBB>ָ<EFBFBD><D6B8><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD>ļ<EFBFBD>ĩβ*/
if (ftell(fp)>0) /*<2A>ļ<EFBFBD><C4BC><EFBFBD>Ϊ<EFBFBD><CEAA>*/
{
rewind(fp); /*<2A>ļ<EFBFBD>λ<EFBFBD><CEBB>ָ<EFBFBD><D6B8><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>ʼλ<CABC><CEBB>*/
for (num=0;!feof(fp) && fread(&student[num],sizeof(struct record),1,fp);num++);
printf("\n\t\t<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}
printf("\n\t\t<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>");
printf("\n\t\tͨѶ¼<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κμ<EFBFBD>¼");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}//<2F>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void mainmenu()//<2F><><EFBFBD>˵<EFBFBD>
{
char choic;
system("cls");
printf("\n\t\t******************* <20><><EFBFBD>˵<EFBFBD> ********************");
printf("\n\t\t********** 1-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼ 2-<2D>޸ļ<DEB8>¼ *************");
printf("\n\t\t********** 3-<2D><>ѯ<EFBFBD>˵<EFBFBD> 4-ɾ<><C9BE><EFBFBD><EFBFBD>¼ *************");
printf("\n\t\t********** 5-<2D><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD> 6-<2D><><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD> *************");
printf("\n\t\t********** 7-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD> *************");
printf("\n\t\t************************************************");
printf("\n\t\t<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
choic=getch();
switch (choic)
{
case '1':newrecord();break;
case '2':modify();break;
case '3':searchmenu();break;
case '4':deletemenu();break;
case '5':listmenu();break;
case '6':writetofile();break;
case '7':exit(0);
default:mainmenu();
}
}
void newrecord()//<2F><><EFBFBD>Ӽ<EFBFBD>¼
{
printf("\n\t\t**************** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ϣ ****************\n");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
scanf("%s",&student[num].nativeplace);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
scanf("%s",&student[num].name);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1:");
scanf("%s",&student[num].phone1);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2:");
scanf("%s",&student[num].phone2);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>e-mail:");
scanf("%s",&student[num].e_mail);
num++;/*ͳ<><CDB3><EFBFBD><EFBFBD>ϵ<EFBFBD>˸<EFBFBD><CBB8><EFBFBD>*/
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?(Y/N):");
if (getch()=='y')
newrecord();
return;
}//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>
void deletemenu()//ɾ<><C9BE><EFBFBD>˵<EFBFBD>
{
char choic;
if(num==0)
{
printf("\n\t\t<EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κμ<EFBFBD>¼");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}
system("cls");
printf("\n\t\t******************* ɾ<><C9BE><EFBFBD>˵<EFBFBD> *******************");
printf("\n\t\t*********** 1-ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2-ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ***********");
printf("\n\t\t*********** 3-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD> ***********");
printf("\n\t\t************************************************");
printf("\n\t\t<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
choic=getch();
switch (choic)
{
case '1':deleteall();break;
case '2':deleteone();break;
case '3':mainmenu();break;
default:mainmenu();break;
}
}
void deleteall()//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
printf("\n\t\tȷ<EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>?(y/n)");
if (getch()=='y')
{
fclose(fp);
if ((fp=fopen("student.bin","wb"))==NULL)
{
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>");
readfromfile();
}
num=0;
printf("\n\t\t<EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}
else
return;
}
void deletebyname()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>
{
int a=0;
int findmark=0;
int j;
int deletemark=0;
int i;
char name[20];
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%s",name);
for (i=a;i<num;i++)
{
if (strcmp(student[i].name,name)==NULL)
{
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>¼<EFBFBD><EFBFBD>");
findmark++;
printf("\n\t\t________________________________");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD>᣺ %s",student[i].nativeplace);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s",student[i].name);
printf("\n\t\t<EFBFBD>绰1<EFBFBD><EFBFBD> %s",student[i].phone1);
printf("\n\t\t<EFBFBD>绰2<EFBFBD><EFBFBD> %s",student[i].phone2);
printf("\n\t\te-mail<69><6C>%s",student[i].e_mail);
printf("\n\t\t________________________________");
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD>ɾ<EFBFBD><EFBFBD>?(y/n)");
if (getch()=='y')
{
for (j=i;j<num-1;j++) /*<2A><>¼<EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>stud<75><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>֮*/
student[j]=student[j+1];
num--;
deletemark++;
printf("\n\t\tɾ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>");
if((i+1)<num)
{
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ?(y/n)");
if (getch()=='y')
{
a=i;
continue;
}
}
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>?(y/n)");
if (getch()=='y')
deletebyname();
return;
}
if((i+1)<num)
{
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ?(y/n)");
if (getch()=='y')
{
a=i;
continue;
}
}
}
else
continue;
}
if ((deletemark==0)&&(findmark==0))
{
printf("\n\t\tû<EFBFBD>и<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵ļ<EFBFBD>¼");
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>?(y/n)");
if (getch()=='y')
deletebynativeplace();
return;
}
else if (findmark!=0)
{
printf("\n\t\tû<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ");
printf("\n\t\tû<EFBFBD>и<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵ļ<EFBFBD>¼");
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>?(y/n)");
if (getch()=='y')
deletebynativeplace();
return;
}
}
void deleteone()//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
char choic;
printf("\n\t\t1-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE> 2-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>");
printf("\n\t\t<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
choic=getch();
switch (choic)
{
case '1':deletebynativeplace();break;
case '2':deletebyname();break;
}
}
void deletebynativeplace()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>
{
int i,j;
int deletemark=0;
char nativeplace[20];
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˼<EFBFBD><EFBFBD>");
scanf("%s",nativeplace);
if(num==0)
{
printf("\n\t\t<EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κμ<EFBFBD>¼");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}
for (i=0;i<num;i++)
{
if (strcmp(student[i].nativeplace,nativeplace)==NULL)
{
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˼<EFBFBD>¼<EFBFBD><EFBFBD>");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD>᣺ %s",student[i].nativeplace);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s",student[i].name);
printf("\n\t\t<EFBFBD>绰1<EFBFBD><EFBFBD> %s",student[i].phone1);
printf("\n\t\t<EFBFBD>绰2<EFBFBD><EFBFBD> %s",student[i].phone2);
printf("\n\t\te-mail<69><6C>%s",student[i].e_mail);
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD>ɾ<EFBFBD><EFBFBD>?(y/n)");
if (getch()=='y')
{
for (j=i;j<num-1;j++) /*<2A><>¼<EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>stud<75><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>֮*/
student[j]=student[j+1];
num--;
deletemark++;
printf("\n\t\tɾ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>");
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>?(y/n)");
if (getch()=='y')
deletebynativeplace();
return;
}
else
return;
}
continue;
}
if (deletemark==0)
{
printf("\n\t\tû<EFBFBD>и<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵ļ<EFBFBD>¼");
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>?(y/n)");
if (getch()=='y')
deletebynativeplace();
return;
}
}
void modify()//<2F>޸<EFBFBD><DEB8><EFBFBD>ϵ<EFBFBD><CFB5>
{
char c;
int mark=0;
int i;
int a=0;
if(num==0)
{
printf("\n\t\t<EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κμ<EFBFBD>¼");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}
system("cls");
printf("\n\t\t********* <20>޸<EFBFBD><DEB8><EFBFBD>ϵ<EFBFBD>˲˵<CBB2> *********");
printf("\n\t\t** 1-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD> 2-<2D><><EFBFBD>绰1<E7BBB0>޸<EFBFBD> **");
printf("\n\t\t** 3-<2D><><EFBFBD>绰2<E7BBB0>޸<EFBFBD> **");
printf("\n\t\t********<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>*********");
c=getch();
switch(c)
{
case '1':modifyname();break;
case '2':modifyphone1();break;
case '3':modifyphone2();break;
default:mainmenu();break;
}
}
void modifyname()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>
{
char choic;
int i;
int mark=0;
int a=0;
char name[20];
printf("\n\t\t<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<num;i++)
{
if(strcmp(student[i].name,name)==0)
{
printf("\n\t\t******<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>޸ĵ<DEB8><C4B5><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ϣ******");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD>᣺ %s",student[i].nativeplace);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s",student[i].name);
printf("\n\t\t<EFBFBD>绰1<EFBFBD><EFBFBD> %s",student[i].phone1);
printf("\n\t\t<EFBFBD>绰2<EFBFBD><EFBFBD> %s",student[i].phone2);
printf("\n\t\te-mail<69><6C>%s",student[i].e_mail);
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD>޸<EFBFBD>(y/n)");
if(getch()=='y')
{
printf("\n\t\t******** <20><>ѡ<EFBFBD><D1A1><EFBFBD>޸<EFBFBD><DEB8><EFBFBD>Ϣ ********");
printf("\n\t\t** 1-<2D>޸<EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD> 2-<2D>޸ĵ绰1 **");
printf("\n\t\t** 3-<2D>޸ĵ绰2 4-<2D>޸ļ<DEB8><C4BC><EFBFBD> **");
printf("\n\t\t** 5-<2D>޸ĵ<DEB8><C4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ********");
printf("\n\t\t********************************");
printf("\n\t\t<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%s",&choic);
switch(choic)
{
case '1':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>");
scanf("%s",student[i].name);break;
case '2':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ绰1<EFBFBD><EFBFBD>");
scanf("%s",student[i].phone1);break;
case '3':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ绰2<EFBFBD><EFBFBD>");
scanf("%s",student[i].phone2);break;
case '4':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>");
scanf("%s",student[i].nativeplace);break;
case '5':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%s",student[i].e_mail);break;
}printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<EFBFBD>(y/n);");
if(getch()=='y')
modifyname();
return;
}
mark++;
}
}
if(mark==0)
{
printf("\n\t\tû<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ");
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<EFBFBD>(Y/N);");
if(getch()=='Y')
modifyname();
return;
}
}
void modifyphone1()//<2F><><EFBFBD>绰1<E7BBB0>޸<EFBFBD>
{
char choic;
char phone1[20];
int i;
int mark=0;
int a=0;
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>޸<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵ĺ<EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>");
scanf("%s",phone1);
for(i=0;i<num;i++)
{
if(strcmp(student[i].phone1,phone1)==0)
{
printf("\n\t\t******<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>޸ĵ<DEB8><C4B5><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ϣ******");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD>᣺ %s",student[i].nativeplace);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s",student[i].name);
printf("\n\t\t<EFBFBD>绰1<EFBFBD><EFBFBD> %s",student[i].phone1);
printf("\n\t\t<EFBFBD>绰2<EFBFBD><EFBFBD> %s",student[i].phone2);
printf("\n\t\te-mail<69><6C>%s",student[i].e_mail);
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD>޸<EFBFBD>(y/n)");
mark++;
if(getch()=='y')
{
printf("\n\t\t******** <20><>ѡ<EFBFBD><D1A1><EFBFBD>޸<EFBFBD><DEB8><EFBFBD>Ϣ ********");
printf("\n\t\t** 1-<2D>޸<EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD> 2-<2D>޸ĵ绰1 **");
printf("\n\t\t** 3-<2D>޸ĵ绰2 4-<2D>޸ļ<DEB8><C4BC><EFBFBD> **");
printf("\n\t\t** 5-<2D>޸ĵ<DEB8><C4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ********");
printf("\n\t\t********************************");
printf("\n\t\t<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%s",&choic);
switch(choic)
{
case '1':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>");
scanf("%s",student[i].name);break;
case '2':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ绰1<EFBFBD><EFBFBD>");
scanf("%s",student[i].phone1);break;
case '3':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ绰2<EFBFBD><EFBFBD>");
scanf("%s",student[i].phone2);break;
case '4':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>");
scanf("%s",student[i].nativeplace);break;
case '5':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%s",student[i].e_mail);break;
}printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<EFBFBD>(y/n);");
if(getch()=='y')
modifyname();
return;
}
mark++;
}
}
if(mark==0)
{
printf("\n\t\tû<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ");
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<EFBFBD>(Y/N);");
if(getch()=='Y')
modifyname();
return;
}
}
void modifyphone2()//<2F><><EFBFBD>绰2<E7BBB0>޸<EFBFBD>
{
char choic;
char phone2[20];
int i;
int mark=0;
int a=0;
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>޸<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵ĺ<EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>");
scanf("%s",phone2);
for(i=0;i<num;i++)
{
if(strcmp(student[i].phone2,phone2)==0)
{
printf("\n\t\t******<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>޸ĵ<DEB8><C4B5><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ϣ******");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD>᣺ %s",student[i].nativeplace);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s",student[i].name);
printf("\n\t\t<EFBFBD>绰1<EFBFBD><EFBFBD> %s",student[i].phone1);
printf("\n\t\t<EFBFBD>绰2<EFBFBD><EFBFBD> %s",student[i].phone2);
printf("\n\t\te-mail<69><6C>%s",student[i].e_mail);
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD>޸<EFBFBD>(y/n)");
mark++;
if(getch()=='y')
{
printf("\n\t\t******** <20><>ѡ<EFBFBD><D1A1><EFBFBD>޸<EFBFBD><DEB8><EFBFBD>Ϣ ********");
printf("\n\t\t** 1-<2D>޸<EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD> 2-<2D>޸ĵ绰1 **");
printf("\n\t\t** 3-<2D>޸ĵ绰2 4-<2D>޸ļ<DEB8><C4BC><EFBFBD> **");
printf("\n\t\t** 5-<2D>޸ĵ<DEB8><C4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ********");
printf("\n\t\t********************************");
printf("\n\t\t<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%s",&choic);
switch(choic)
{
case '1':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>");
scanf("%s",student[i].name);break;
case '2':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ绰1<EFBFBD><EFBFBD>");
scanf("%s",student[i].phone1);break;
case '3':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ绰2<EFBFBD><EFBFBD>");
scanf("%s",student[i].phone2);break;
case '4':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>");
scanf("%s",student[i].nativeplace);break;
case '5':printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%s",student[i].e_mail);break;
}printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<EFBFBD>(y/n);");
if(getch()=='y')
modifyname();
return;
}
mark++;
}
}
if(mark==0)
{
printf("\n\t\tû<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ");
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<EFBFBD>(Y/N);");
if(getch()=='Y')
modifyname();
return;
}
}
void showall()//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
{
int i;
system("cls");
if(num!=0)
{
printf("\n\t\t*************** <20><><EFBFBD><EFBFBD>ΪͨѶ¼<D1B6><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ************");
for (i=0;i<num;i++)
{
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD>᣺ %s",student[i].nativeplace);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s",student[i].name);
printf("\n\t\t<EFBFBD>绰1<EFBFBD><EFBFBD> %s",student[i].phone1);
printf("\n\t\t<EFBFBD>绰2<EFBFBD><EFBFBD> %s",student[i].phone2);
printf("\n\t\te-mail<69><6C>%s",student[i].e_mail);
printf("\t\t");
if (i+1<num)
{
printf("\n\t\t__________________________");
system("pause");
}
}
printf("\n\t\t************************************************");
}
else
printf("\n\t\tͨѶ¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κμ<EFBFBD>¼");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>");
getch();
return;
}
void searchmenu()//<2F><>ѯ<EFBFBD>˵<EFBFBD>
{
char choic;
system("cls");
printf("\n\t\t******************* <20><>ѯ<EFBFBD>˵<EFBFBD> **********************");
printf("\n\t\t********** 1-<2D><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD> 2-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ *************");
printf("\n\t\t********** 3-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ 4-<2D><><EFBFBD>绰1<E7BBB0><31>ѯ ************");
printf("\n\t\t********** 5-<2D><><EFBFBD>绰2<E7BBB0><32>ѯ 6-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD> *************");
printf("\n\t\t***************************************************");
printf("\n\t\t<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
choic=getch();
switch (choic)
{
case '1':showall();break;
case '2':searchbynativeplace();break;
case '3':searchbyname();break;
case '4':searchbyphone1();break;
case '5':searchbyphone2();break;
case '6':mainmenu();break;
}
}
void searchbynativeplace()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ
{
int mark=0;
int i;
int a=0;
printf("\n\t\t****************** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ******************\n");
char nativeplace[20];
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
scanf("%s",nativeplace);
for(i=0;i<num;i++)
{
if (strcmp(student[i].nativeplace,nativeplace)==0)
{
printf("\n\t\t************** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ϣ **********");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD>᣺ %s",student[i].nativeplace);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s",student[i].name);
printf("\n\t\t<EFBFBD>绰1<EFBFBD><EFBFBD> %s",student[i].phone1);
printf("\n\t\t<EFBFBD>绰2<EFBFBD><EFBFBD> %s",student[i].phone2);
printf("\n\t\te-mail<69><6C>%s",student[i].e_mail);
printf("\n\t\t************************************************");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>");
mark++;
getch();
return;
}
}
if (mark==0)
{
printf("\n\t\tû<EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>Ϣ");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}
}
void searchbyname()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ
{
int mark=0;
int i;
int a=0;
printf("\n\t\t***************** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *******************");
char name[20];
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
scanf("%s",name);
for(i=a;i<num;i++)
{
if (strcmp(student[i].name,name)==0)
{
printf("\n\t\t************* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ϣ ***********");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD>᣺ %s",student[i].nativeplace);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s",student[i].name);
printf("\n\t\t<EFBFBD>绰1<EFBFBD><EFBFBD> %s",student[i].phone1);
printf("\n\t\t<EFBFBD>绰2<EFBFBD><EFBFBD> %s",student[i].phone2);
printf("\n\t\te-mail<69><6C>%s",student[i].e_mail);
printf("\n\t\t************************************************");
mark++;
if ((i+1)<num)
{
printf("\n\t\t<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>(y/n)");
if (getch()=='y')
{
a=i;
continue;
}
else
return;
}
else
{
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}
}
}
if(mark!=0)
{
printf("\n\t\tû<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˼<EFBFBD>¼");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}
else
{
printf("\n\t\tû<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˼<EFBFBD>¼");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}
}
void searchbyphone1()//<2F><><EFBFBD>绰1<E7BBB0><31>ѯ
{
int mark=0;
int i;
int a=0;
printf("\n\t\t****************** <20><><EFBFBD>绰1<E7BBB0><31><EFBFBD><EFBFBD> ******************");
char phone1[10];
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>绰1:");
scanf("%s",phone1);
for(i=0;i<num;i++)
{
if (strcmp(student[i].phone1,phone1)==0)
{
printf("\n\t\t************** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ϣ **********");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD>᣺ %s",student[i].nativeplace);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s",student[i].name);
printf("\n\t\t<EFBFBD>绰1<EFBFBD><EFBFBD> %s",student[i].phone1);
printf("\n\t\t<EFBFBD>绰2<EFBFBD><EFBFBD> %s",student[i].phone2);
printf("\n\t\te-mail<69><6C>%s",student[i].e_mail);
printf("\n\t\t************************************************");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>");
mark++;
getch();
return;
}
}
if (mark==0)
{
printf("\n\t\tû<EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>Ϣ");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}
}
void searchbyphone2() //<2F><><EFBFBD>绰2<E7BBB0><32>ѯ
{
int mark=0;
int i;
int a=0;
printf("\n\t\t****************** <20><><EFBFBD>绰2<E7BBB0><32><EFBFBD><EFBFBD> ******************");
char phone2[10];
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>绰2:");
scanf("%s",phone2);
for(i=0;i<num;i++)
{
if (strcmp(student[i].phone2,phone2)==0)
{
printf("\n\t\t************** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ϣ **********");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD>᣺ %s",student[i].nativeplace);
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s",student[i].name);
printf("\n\t\t<EFBFBD>绰1<EFBFBD><EFBFBD> %s",student[i].phone1);
printf("\n\t\t<EFBFBD>绰2<EFBFBD><EFBFBD> %s",student[i].phone2);
printf("\n\t\te-mail<69><6C>%s",student[i].e_mail);
printf("\n\t\t************************************************");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>");
mark++;
getch();
return;
}
}
if (mark==0)
{
printf("\n\t\tû<EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>Ϣ");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}
}
void listmenu()//<2F><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>
{
char choic;
if(num==0)
{
printf("\n\t\t<EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κμ<EFBFBD>¼");
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
getch();
return;
}
system("cls");
printf("\n\t\t******************* <20><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD> *******************");
printf("\n\t\t********** 1-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> **********");
printf("\n\t\t********** 3-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD> **********");
printf("\n\t\t************************************************");
printf("\n\t\t<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
choic=getch();
switch(choic)
{
case '1':listbynativeplace();break;
case '2':listbyname();break;
case '3':mainmenu();break;
default:mainmenu();break;
}
}
void listbynativeplace()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
int i,j;
struct record tmp;
for (i=1;i<num;i++)
{
if(strcmp(student[i].nativeplace,student[i-1].nativeplace)<0)
{
tmp=student[i];
j=i-1;
do
{
student[j+1]=student[j];
j--;
}while ((strcmp(tmp.nativeplace,student[j].nativeplace)<0)&&j>=0);
student[j+1]=tmp;
}
}
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>,<2C>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ?(y/n)");
if (getch()=='y')
showall();
return;
}
void listbyname()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
int i,j;
struct record tmp;
for (i=1;i<num;i++)
{
if(strcmp(student[i].name,student[i-1].name)<0)
{
tmp=student[i];
j=i-1;
do
{
student[j+1]=student[j];
j--;
}while ((strcmp(tmp.name,student[j].name)<0&&j>=0));
student[j+1]=tmp;
}
}
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>,<2C>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ?(y/n)");
if (getch()=='y')
showall();
return;
}