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.
sunyiyang/学生成绩管理系统.cpp

489 lines
12 KiB

6 years ago
#include<stdio.h>
#include<string.h>
#include<malloc.h>
#include<windows.h>
6 years ago
#define BUFSIZE 20
6 years ago
struct node //<2F><EFBFBD><E1B9B9>
{
int num; //ѧ<><D1A7>
char name[15]; // <20><><EFBFBD><EFBFBD>
int gs; //<2F><><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD>
int yy; //Ӣ<><D3A2><EFBFBD>ɼ<EFBFBD>
int c; //c<><63><EFBFBD>Գɼ<D4B3>
node *next;//ָ<><D6B8>
};
node *create()//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
{
struct node * head,* p,* q; //*pָ<70><D6B8>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>*qָ<71><D6B8>β<EFBFBD><CEB2>
int number;
char sname[15];
int sgs,syy,sc;
head=(node *)malloc(sizeof(node)); //<2F><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
if(head==NULL)
{printf("<EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
}
else
{
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӣ<EFBFBD>C<EFA3AC><43><EFBFBD><EFBFBD>\n");
scanf("%d",&number);//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>
scanf("%s",&sname);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
scanf("%d",&sgs);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD>
scanf("%d",&syy);//<2F><><EFBFBD><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD>ɼ<EFBFBD>
scanf("%d",&sc);//<2F><><EFBFBD><EFBFBD>c<EFBFBD><63><EFBFBD>Գɼ<D4B3>
head->num=number;//<2F><>ֵ
head->gs=sgs;//<2F><>ֵ
head->yy=syy;//<2F><>ֵ
head->c=sc;//<2F><>ֵ
strcpy(head->name,sname);//<2F><>ֵ
head->next=NULL;//ָ<><D6B8><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
p=head;
while(1)
{
q=(node *)malloc(sizeof(node));//<2F><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӣ<EFBFBD>C<EFA3AC><43><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><30><CAB1><EFBFBD><EFBFBD>)\n");
scanf("%d",&number);//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>
if(number==0)
{
break;//<2F><><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
}
scanf("%s",&sname);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
scanf("%d",&sgs);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD>
scanf("%d",&syy);//<2F><><EFBFBD><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD>ɼ<EFBFBD>
scanf("%d",&sc);//<2F><><EFBFBD><EFBFBD>c<EFBFBD><63><EFBFBD>Գɼ<D4B3>
q->num=number;//<2F><>ֵ
q->gs=sgs;//<2F><>ֵ
q->yy=syy;//<2F><>ֵ
q->c=sc;//<2F><>ֵ
strcpy(q->name,sname);//<2F><>ֵ
q->next=NULL;//qָ<71><D6B8><EFBFBD>¸<EFBFBD><C2B8><EFBFBD><E1B9B9><EFBFBD><EFBFBD>β<EFBFBD><CEB2><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
p->next=q; //
p=q;
}
return head;//<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>
}
}
node *jiaru(node *head)//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
{
node *p,* q;
int number;
char sname[15];
int sgs,syy,sc;
p=head;
while(p->next!=NULL)
{
p=p->next;
}
while(1)
{
q=(node *)malloc(sizeof(node));//<2F><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӣ<EFBFBD>C<EFA3AC><43><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><30><CAB1><EFBFBD><EFBFBD>)\n");
scanf("%d",&number);//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>
if(number==0)
{
break;//<2F><><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
}
scanf("%s",&sname);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
scanf("%d",&sgs);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD>
scanf("%d",&syy);//<2F><><EFBFBD><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD>ɼ<EFBFBD>
scanf("%d",&sc);//<2F><><EFBFBD><EFBFBD>c<EFBFBD><63><EFBFBD>Գɼ<D4B3>
q->num=number;//<2F><>ֵ
q->gs=sgs;//<2F><>ֵ
q->yy=syy;//<2F><>ֵ
q->c=sc;//<2F><>ֵ
strcpy(q->name,sname);//<2F><>ֵ
q->next=NULL;//ָ<><D6B8><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
p->next=q;
p=q;
}
return head;//<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>
}
node * delete_name(node *head)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
{
node *b,*p;
p=head;
char qname[15];
char c;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
scanf("%s",&qname);//<2F><><EFBFBD><EFBFBD>Ҫɾ<D2AA><C9BE>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
while(1)
{
if(p==NULL)
{
return head;//<2F><><EFBFBD><EFBFBD>ϢΪ<CFA2><CEAA><EFBFBD>򷵻<EFBFBD>ԭͷ<D4AD><CDB7><EFBFBD><EFBFBD>
}
if(strcmp(p->name,qname)==0)
{
printf("ȷ<EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>y/n:");
scanf("%s",&c);
if(c=='y')
{
if(p==head)//<2F>ж<EFBFBD>ͷָ<CDB7><D6B8>
{
head=p->next;
free(p);//<2F>ͷ<EFBFBD><CDB7>ڴ<EFBFBD><DAB4>ռ<EFBFBD>
printf("ɾ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>\n");
return head;//<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>
}
else
{
b->next=p->next;//ʹp<CAB9><70><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
free(p);//<2F>ͷ<EFBFBD><CDB7>ڴ<EFBFBD><DAB4>ռ<EFBFBD>
printf("ɾ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>\n");
return head;//<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>
}
}
else
printf("<EFBFBD>˳<EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
}
b=p;
p=p->next;//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
printf("ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
return head;//<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>
}
node * delete_i(node *head)//<2F><>ѧ<EFBFBD><D1A7>ɾ<EFBFBD><C9BE>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
{
node *b,*p;
p=head;
int i;
char c;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>:");
scanf("%d",&i);//<2F><><EFBFBD><EFBFBD>Ҫɾ<D2AA><C9BE>ѧ<EFBFBD><D1A7>ѧ<EFBFBD><D1A7>
while(1)
{
if(p==NULL)
{
return head;//<2F><><EFBFBD><EFBFBD>ϢΪ<CFA2><CEAA><EFBFBD>򷵻<EFBFBD>ԭͷ<D4AD><CDB7><EFBFBD><EFBFBD>
}
if(p->num==i)
{
printf("ȷ<EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>y/n:");
scanf("%s",&c);
if(c=='y')
{
if(p==head)
{
head=p->next;
free(p);//<2F>ͷ<EFBFBD><CDB7>ڴ<EFBFBD><DAB4>ռ<EFBFBD>
printf("ɾ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>\n");
return head;//<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>
}
else
{
b->next=p->next;//ʹp<CAB9><70><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
free(p);//<2F>ͷ<EFBFBD><CDB7>ڴ<EFBFBD><DAB4>ռ<EFBFBD>
printf("ɾ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>\n");
return head;//<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>
}
}
else
printf("<EFBFBD>˳<EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
}
b=p;
p=p->next;//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
printf("ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
return head;//<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>
}
int query_name(node * head)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
{
struct node * p;
char sname[20];
p=head;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
scanf("%s",&sname);//<2F><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
while(p!=NULL)//ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD><70><EFBFBD>㲻ΪNULL
{
if(strcmp(p->name,sname)==0)
{
printf("---------------------------------------------\n");
printf(" %d | %s | %d | %d | %d\n",p->num,p->name,p->gs,p->yy,p->c);
printf("---------------------------------------------\n");
return 1;
}
p=p->next;//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
printf("û<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
return 0;
}
int query_i(node * head)//<2F><>ѧ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
{
struct node * p;
int i;
p=head;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD>ѧ<EFBFBD><EFBFBD>:");
scanf("%d",&i);//<2F><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>
while(p!=NULL)//ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD><70><EFBFBD>㲻ΪNULL
{
if(p->num==i)
{
printf(" ѧ<><D1A7> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> Ӣ<><D3A2> c<><63><EFBFBD><EFBFBD>\n");
printf("---------------------------------------------\n");
printf(" %d | %s | %d | %d | %d\n",p->num,p->name,p->gs,p->yy,p->c);
printf("---------------------------------------------\n");
return 1;
}
p=p->next;//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
printf("û<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
return 0;
}
int install_name(node * head)//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ij<EFBFBD><C4B3><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>֮<EFBFBD><D6AE>
{
struct node *p,*n;
p=head;
n=(node *)malloc(sizeof(node));//<2F><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>
int number;
char sname[15],qname[15];
int sgs,syy,sc;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӣ<EFBFBD>C<EFA3AC><43><EFBFBD><EFBFBD>\n");
scanf("%d",&number);//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>
scanf("%s",&sname);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
scanf("%d",&sgs);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD>
scanf("%d",&syy);//<2F><><EFBFBD><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD>ɼ<EFBFBD>
scanf("%d",&sc);//<2F><><EFBFBD><EFBFBD>c<EFBFBD><63><EFBFBD>Գɼ<D4B3>
n->num=number;//<2F><>ֵ
n->gs=sgs;//<2F><>ֵ
n->yy=syy;//<2F><>ֵ
n->c=sc;//<2F><>ֵ
strcpy(n->name,sname);//<2F><>ֵ
n->next=NULL;//ָ<><D6B8><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
scanf("%s",&qname);
while(p!=NULL)//ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD><70><EFBFBD>㲻ΪNULL
{
if(strcmp(p->name,qname)==0)
{
n->next=p->next;//<2F><><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD>
p->next=n;//<2F><><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD>
return 1;
}
p=p->next;//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
printf("û<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
return 0;
}
int install_i(node * head)//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD>ڼ<EFBFBD>λѧ<CEBB><D1A7>֮<EFBFBD><D6AE>
{
struct node *p,*n;
p=head;
n=(node *)malloc(sizeof(node));// <20><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>
int number,inno,j=1;
char sname[15]; ;
int sgs,syy,sc;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӣ<EFBFBD>C<EFA3AC><43><EFBFBD><EFBFBD>\n");
scanf("%d",&number);//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>
scanf("%s",&sname);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
scanf("%d",&sgs);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD>
scanf("%d",&syy);//<2F><><EFBFBD><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD>ɼ<EFBFBD>
scanf("%d",&sc);//<2F><><EFBFBD><EFBFBD>c<EFBFBD><63><EFBFBD>Գɼ<D4B3>
n->num=number;//<2F><>ֵ
n->gs=sgs;//<2F><>ֵ
n->yy=syy;//<2F><>ֵ
n->c=sc;//<2F><>ֵ
strcpy(n->name,sname);//<2F><>ֵ
n->next=NULL;//ָ<><D6B8><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>λѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%d",&inno);
while(p!=NULL&&j<inno)//
{
p=p->next;
j++;
}
if(j==inno)
{
n->next=p->next;
p->next=n;
return 1;
}
printf("û<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
return 0;
}
int xiugai_name(node *head)//ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
{
node *p;
p=head;
char sname[15];
int sgs,syy,sc,number;
if(p==NULL)//<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA>
{
printf("<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
}
else
{
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>޸ĵ<EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
scanf("%s",&sname);
while(p!=NULL)
{
if(strcmp(p->name,sname)==0)//<2F>ҵ<EFBFBD><D2B5><EFBFBD>ͬѧ
{
printf("<EFBFBD><EFBFBD><EFBFBD>޸ĸ<EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>:\n");
scanf("%d",&number);
p->num=number;
printf("<EFBFBD><EFBFBD><EFBFBD>޸ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
scanf("%s",&sname);
strcpy(p->name,sname);
printf("<EFBFBD><EFBFBD><EFBFBD>޸ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴɼ<EFBFBD>:\n");
scanf("%d%d%d",&sgs,&syy,&sc);
p->gs=sgs;
p->yy=syy;
p->c=sc;
return 1;
}
p=p->next;
}
printf("<EFBFBD>޸<EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
}
}
int xiugai_i(node *head)//ͨ<><CDA8>ѧ<EFBFBD><D1A7><EFBFBD>޸<EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
{
node *p;
p=head;
char sname[15];
int sgs,syy,sc,number;
if(p==NULL)//<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA>
{
printf("<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
}
else
{
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>޸ĵ<EFBFBD>ѧ<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>:\n");
scanf("%d",&number);
while(p!=NULL)
{
if(p->num==number)//<2F>ҵ<EFBFBD><D2B5><EFBFBD>ͬѧ
{
printf("<EFBFBD><EFBFBD><EFBFBD>޸ĸ<EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>:\n");
scanf("%d",&number);
p->num=number;
printf("<EFBFBD><EFBFBD><EFBFBD>޸ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
scanf("%s",&sname);
strcpy(p->name,sname);
printf("<EFBFBD><EFBFBD><EFBFBD>޸ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴɼ<EFBFBD>:\n");
scanf("%d%d%d",&sgs,&syy,&sc);
p->gs=sgs;
p->yy=syy;
p->c=sc;
return 1;
}
p=p->next;
}
printf("<EFBFBD>޸<EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
}
}
void printf(node * head)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
{
6 years ago
FILE *fp;
char buf[BUFSIZE];
//<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
fp=fopen("D:\\1.txt","r");
//<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7>ɹ<EFBFBD>
if(NULL==fp)
{
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
}
//<2F><>ȡ<EFBFBD>ļ<EFBFBD>
while(fgets(buf,BUFSIZE,fp))
{
printf("%s",buf);
}
//<2F>ر<EFBFBD><D8B1>ļ<EFBFBD>
fclose(fp);
6 years ago
struct node *p;
p=head;
6 years ago
printf("\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>");
printf("\n ѧ<><D1A7> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> Ӣ<><D3A2> c<><63><EFBFBD><EFBFBD>\n");
6 years ago
while(p!=NULL)//ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD><70><EFBFBD>㲻ΪNULL
{
printf("---------------------------------------------\n");
printf(" %d | %s | %d | %d | %d\n",p->num,p->name,p->gs,p->yy,p->c);
p=p->next;
}
printf("---------------------------------------------\n");
}
int main()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
6 years ago
6 years ago
char name[15];
int n;
6 years ago
struct node * head;
6 years ago
system("color 4f");
printf("\n*************ѧ<><D1A7><EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>ϵͳ****************\n");
printf("*********************************************\n");
while(1)
{
printf(" * 1.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ *\n");
printf(" * *\n");
printf(" * 2.<2E><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ *\n");
printf(" * *\n");
printf(" * 3.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ *\n");
printf(" * *\n");
printf(" * 4.<2E><><EFBFBD><EFBFBD>ѧ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ *\n");
printf(" * *\n");
printf(" * 5.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ *\n");
printf(" * *\n");
printf(" * 6.<2E><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>ɾ<EFBFBD><C9BE>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ *\n");
printf(" * *\n");
printf(" * 7.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ *\n");
printf(" * *\n");
printf(" * 8.<2E><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD>޸<EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ *\n");
printf(" * *\n");
printf(" * 9.<2E><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ij<EFBFBD><C4B3><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>֮<EFBFBD><D6AE> *\n");
printf(" * *\n");
printf(" * 10.<2E><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD>ڼ<EFBFBD>λѧ<CEBB><D1A7>֮<EFBFBD><D6AE> *\n");
printf(" * *\n");
printf(" * 11.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ *\n");
printf(" * *\n");
printf(" * 0.<2E>˳<EFBFBD> *\n\n");
printf("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
scanf("%d",&n); //<2F>жϲ<D0B6><CFB2><EFBFBD>
if(n==1)
head=create();
if(n==2)
head=jiaru(head);
if(n==3)
query_name(head);
if(n==4)
query_i(head);
if(n==5)
head=delete_name(head);
if(n==6)
head=delete_i(head);
if(n==7)
xiugai_name(head);
if(n==8)
xiugai_i(head);
if(n==9)
install_name(head);
if(n==10)
install_i(head);
if(n==11)
printf(head);
if(n==0)
{
printf("ллʹ<EFBFBD>ã<EFBFBD>\n");
break;
}
}
}