|
|
|
|
//*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*//
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>C<EFBFBD>̽<EFBFBD><CCBD><EFBFBD>һ<EFBFBD><D2BB>"dat.txt"<22>ļ<EFBFBD>//
|
|
|
|
|
#include<stdio.h>
|
|
|
|
|
#include<stdlib.h>
|
|
|
|
|
#include<string.h>
|
|
|
|
|
#define Length sizeof(struct student) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٿռ<D9BF>
|
|
|
|
|
int n=0;
|
|
|
|
|
struct student
|
|
|
|
|
{
|
|
|
|
|
char name[20]; //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
char num[20]; //ѧ<><D1A7>
|
|
|
|
|
char Class[20]; //<2F>༶
|
|
|
|
|
char sex[20]; //<2F>Ա<EFBFBD>
|
|
|
|
|
int age; //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
char ps[100]; //<2F><>ע(postscript)
|
|
|
|
|
struct student *next;
|
|
|
|
|
}*head,*p,*p1,*p2; //head<61><64>ʾ<EFBFBD><CABE>ͷ p<><70>ʾ<EFBFBD><CABE>ͬλ<CDAC>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void add() //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
p1=(struct student *)malloc(Length); //<2F><><EFBFBD>ٴ洢<D9B4>ռ<EFBFBD>
|
|
|
|
|
if(n==0) //<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ
|
|
|
|
|
head=p1; //n=0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǵ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //p2<70>Ľ<EFBFBD>β<EFBFBD><CEB2>ָ<EFBFBD><D6B8><EFBFBD>ĵ<EFBFBD>ַ<EFBFBD><D6B7>p1
|
|
|
|
|
else p2->next=p1; //n!=0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&p1->name);
|
|
|
|
|
printf("ѧ<EFBFBD>ţ<EFBFBD>");
|
|
|
|
|
scanf("%s",&p1->num);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>䣺");
|
|
|
|
|
scanf("%d",&p1->age);
|
|
|
|
|
printf("<EFBFBD>༶<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&p1->Class);
|
|
|
|
|
printf("<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&p1->sex);
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&p1->ps);
|
|
|
|
|
p2=p1; //p2ָ<32><D6B8>p1<70><31><EFBFBD>ڵĵ<DAB5>ַ
|
|
|
|
|
p2->next=NULL; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־
|
|
|
|
|
n+=1; //n<>ж<EFBFBD><D0B6>Dz<EFBFBD><C7B2>ǵ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
system("pause");
|
|
|
|
|
system("cls");
|
|
|
|
|
}
|
|
|
|
|
void print()
|
|
|
|
|
{
|
|
|
|
|
if(n!=0)
|
|
|
|
|
{
|
|
|
|
|
p=head; //p<><70>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>ͷ
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tѧ<EFBFBD><EFBFBD>\t\t<EFBFBD>༶\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD>Ա<EFBFBD>\t\t<EFBFBD><EFBFBD>ע\n");
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
printf("%-8s%-16s%-8s%-8d%-16s%-8s\n",p->name,p->num,p->Class,p->age,p->sex,p->ps);
|
|
|
|
|
p=p->next; //p<><70>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD> <20><>pָ<70><D6B8>next<78><74><EFBFBD>ж<EFBFBD><D0B6><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
}while(p!=NULL); //ֻҪpָ<70><D6B8><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʹ<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
system("cls");
|
|
|
|
|
}
|
|
|
|
|
void find() //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
void find1();
|
|
|
|
|
void find2();
|
|
|
|
|
if(n!=0)
|
|
|
|
|
{
|
|
|
|
|
int a;
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("1.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n2.<2E><>ѧ<EFBFBD>Ų<EFBFBD>ѯ\n3.<2E><><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD>\n4.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%d",&a);
|
|
|
|
|
switch(a)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
find1();
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
find2();
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
find3();
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
find4();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{printf("<EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n");system("pause");}
|
|
|
|
|
}
|
|
|
|
|
void Delete()
|
|
|
|
|
{
|
|
|
|
|
if(n!=0)
|
|
|
|
|
{
|
|
|
|
|
struct student *f,*l; //<2F><><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD>ָ<EFBFBD><D6B8> fʹ<66><CAB9><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7>ڴ<EFBFBD>!
|
|
|
|
|
char a[20];
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&a);
|
|
|
|
|
p=head;
|
|
|
|
|
if(strcmp(head->name,a)==0)
|
|
|
|
|
{f=head;head=head->next;free(f);}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(p->name,a)==0)
|
|
|
|
|
{f=p;l->next=p->next;free(f);break;}
|
|
|
|
|
l=p; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>if<69><66>ʾ<EFBFBD>ⲻ<EFBFBD><E2B2BB>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ڵ㣬l<E3A3AC><6C>ʱָ<CAB1><D6B8>p ֮<><D6AE>p<EFBFBD><70>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ڵ㣬<DAB5><E3A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<D2AA><C9BE><EFBFBD>Ľڵ<C4BD><DAB5><EFBFBD>ôlָ<6C><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>next<78>ĵ<EFBFBD>ַ
|
|
|
|
|
p=p->next;
|
|
|
|
|
}while(p!=NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
printf("<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>\n");
|
|
|
|
|
system("pause"); //<2F>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
system("cls");
|
|
|
|
|
}
|
|
|
|
|
void amend()
|
|
|
|
|
{
|
|
|
|
|
if(n!=0)
|
|
|
|
|
{
|
|
|
|
|
int c;
|
|
|
|
|
char a[20];
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&a);
|
|
|
|
|
p=head;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(a,p->name)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tѧ<EFBFBD><EFBFBD>\t\t<EFBFBD>༶\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD>Ա<EFBFBD>\t\t<EFBFBD><EFBFBD>ע\n");
|
|
|
|
|
printf("%-8s%-16s%-8s%-8d%-16s%-8s\n",p->name,p->num,p->Class,p->age,p->sex,p->ps);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
p=p->next; ////ָ<><D6B8>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
}while(p!=NULL);
|
|
|
|
|
printf("\n\n1.<2E><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>\n2.<2E><EFBFBD>ѧ<EFBFBD><D1A7>\n3.<2E>İ༶\n4.<2E><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>\n5.<2E><EFBFBD><DEB8>Ա<EFBFBD>\n6.<2E>ı<DEB8>ע\n7.<2E>˳<EFBFBD><CBB3><EFBFBD>\n\n");
|
|
|
|
|
scanf("%d",&c);
|
|
|
|
|
switch(c)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&p->name);break;
|
|
|
|
|
case 2:
|
|
|
|
|
printf("ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&p->num);break;
|
|
|
|
|
case 3:
|
|
|
|
|
printf("<EFBFBD>༶<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&p->Class);break;
|
|
|
|
|
case 4:
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%d",&p->age);break;
|
|
|
|
|
case 5:
|
|
|
|
|
printf("רҵ<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&p->sex);break;
|
|
|
|
|
case 6:
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&p->ps);break;
|
|
|
|
|
case 7:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
printf("\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!\n\n");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
printf("******<2A><><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӵ!\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
system("cls");
|
|
|
|
|
}
|
|
|
|
|
void save()
|
|
|
|
|
{
|
|
|
|
|
FILE *fp;
|
|
|
|
|
struct student *p;
|
|
|
|
|
if((fp=fopen("C:\\data.txt","wb"))==NULL)
|
|
|
|
|
printf("Can not open the file!");
|
|
|
|
|
p=head;
|
|
|
|
|
while(p!=NULL)
|
|
|
|
|
{
|
|
|
|
|
if(fwrite(p,Length,1,fp)!=1)
|
|
|
|
|
{
|
|
|
|
|
printf("д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
fclose(fp);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
p=p->next;
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("<EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
system("cls");
|
|
|
|
|
}
|
|
|
|
|
void read()
|
|
|
|
|
{
|
|
|
|
|
FILE *fp;
|
|
|
|
|
if((fp=fopen("C:\\data.txt","rb+"))==NULL)
|
|
|
|
|
{printf("Can not open file!");exit(0);}
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
p1=malloc(Length);
|
|
|
|
|
if(n==0) //<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ
|
|
|
|
|
head=p1; //n=0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǵ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //p2<70>Ľ<EFBFBD>β<EFBFBD><CEB2>ָ<EFBFBD><D6B8><EFBFBD>ĵ<EFBFBD>ַ<EFBFBD><D6B7>p1
|
|
|
|
|
else
|
|
|
|
|
p2->next=p1;;
|
|
|
|
|
fread(p1,Length,1,fp);
|
|
|
|
|
p2=p1;
|
|
|
|
|
n+=1;
|
|
|
|
|
}while(p2->next!=NULL);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
system("cls");
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>**********************************************
|
|
|
|
|
void main()
|
|
|
|
|
{
|
|
|
|
|
int a=1;
|
|
|
|
|
while(a!=0)
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ѧ <20><> <20><> <20><> <20><> <20><> ϵ ͳ <20><> <20><><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 1.<2E><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ <20><> <20><><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 2.<2E><>ʾȫ<CABE><C8AB><EFBFBD><EFBFBD>Ϣ <20><> <20><><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 3.<2E><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ <20><> <20><><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 4.ɾ<><C9BE>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ <20><> <20><><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 5.<2E><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ <20><> <20><><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 6.<2E><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ <20><> <20><><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 7.<2E><>ȡѧ<C8A1><D1A7><EFBFBD><EFBFBD>Ϣ <20><> <20><><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 0. <20>˳<EFBFBD>ϵͳ <20><> <20><><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>");
|
|
|
|
|
scanf("%d",&a);
|
|
|
|
|
if(a>=0&&a<=9)
|
|
|
|
|
{
|
|
|
|
|
switch(a)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
add();
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
print();
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
find();
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
Delete();
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
amend();
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
save();
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
|
|
|
|
read();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><F3A3ACBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>!\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void find1 ()
|
|
|
|
|
{
|
|
|
|
|
char a[20];
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&a);
|
|
|
|
|
p=head;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(a,p->name)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD>Ϣ<EFBFBD>ѱ<EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tѧ<EFBFBD><EFBFBD>\t\t<EFBFBD>༶\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD>Ա<EFBFBD>\t\t<EFBFBD><EFBFBD>ע\n");
|
|
|
|
|
printf("%-8s%-16s%-8s%-8d%-16s%-8s\n\n",p->name,p->num,p->Class,p->age,p->sex,p->ps);
|
|
|
|
|
}
|
|
|
|
|
p=p->next; ////ָ<><D6B8>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
}while(p!=NULL);
|
|
|
|
|
system("pause");
|
|
|
|
|
system("cls");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
void find2 ()
|
|
|
|
|
{
|
|
|
|
|
char a[20];
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>");
|
|
|
|
|
scanf("%s",&a);
|
|
|
|
|
p=head;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
//ָ<><D6B8>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>ͷ
|
|
|
|
|
if(strcmp(a,p->num)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD>Ϣ<EFBFBD>ѱ<EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tѧ<EFBFBD><EFBFBD>\t\t<EFBFBD>༶\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD>Ա<EFBFBD>\t\t<EFBFBD><EFBFBD>ע\n");
|
|
|
|
|
printf("%-8s%-16s%-8s%-8d%-16s%-8d\n\n",p->name,p->num,p->Class,p->age,p->sex,p->ps);
|
|
|
|
|
}
|
|
|
|
|
p=p->next; //ָ<><D6B8>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
}while(p!=NULL);
|
|
|
|
|
system("pause");
|
|
|
|
|
system("cls");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void find3 ()
|
|
|
|
|
{
|
|
|
|
|
char a[20];
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",&a);
|
|
|
|
|
p=head;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
//ָ<><D6B8>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>ͷ
|
|
|
|
|
if(strcmp(a,p->sex)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD>Ϣ<EFBFBD>ѱ<EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tѧ<EFBFBD><EFBFBD>\t\t<EFBFBD>༶\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD>Ա<EFBFBD>\t\t<EFBFBD><EFBFBD>ע\n");
|
|
|
|
|
printf("%-8s%-16s%-8s%-8d%-16s%-8d\n\n",p->name,p->num,p->Class,p->age,p->sex,p->ps);
|
|
|
|
|
}
|
|
|
|
|
p=p->next; //ָ<><D6B8>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
}while(p!=NULL);
|
|
|
|
|
system("pause");
|
|
|
|
|
system("cls");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void find4 ()
|
|
|
|
|
{
|
|
|
|
|
char a[20];
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺");
|
|
|
|
|
scanf("%s",&a);
|
|
|
|
|
p=head;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
//ָ<><D6B8>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>ͷ
|
|
|
|
|
if(strcmp(a,p->age)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD>Ϣ<EFBFBD>ѱ<EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tѧ<EFBFBD><EFBFBD>\t\t<EFBFBD>༶\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t<EFBFBD>Ա<EFBFBD>\t\t<EFBFBD><EFBFBD>ע\n");
|
|
|
|
|
printf("%-8s%-16s%-8s%-8d%-16s%-8d\n\n",p->name,p->num,p->Class,p->age,p->sex,p->ps);
|
|
|
|
|
}
|
|
|
|
|
p=p->next; //ָ<><D6B8>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
}while(p!=NULL);
|
|
|
|
|
system("pause");
|
|
|
|
|
system("cls");
|
|
|
|
|
}
|
|
|
|
|
|