|
|
|
|
//****************************************ͷ<>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>********************************************
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <conio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
//**********************************************************************************************
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
char num[12]; // ѧ<><D1A7>
|
|
|
|
|
char name[20]; // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
char sex[4]; // <20>Ա<EFBFBD>
|
|
|
|
|
int age; // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
char birth[20]; // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
char home[100]; // סַ
|
|
|
|
|
char tel[15]; // <20>绰
|
|
|
|
|
}student;
|
|
|
|
|
|
|
|
|
|
typedef struct Node //<2F>ڵ<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
student stu; //ѧ<><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
struct Node* pnext;//ָ<><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>ָ<EFBFBD><D6B8>
|
|
|
|
|
}node;
|
|
|
|
|
node* phead=NULL; //ͷ<>ڵ㣨<DAB5><E3A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//****************************************<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>********************************************
|
|
|
|
|
void Inputstudent(); //¼<><C2BC>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void Printstudent(); //<2F><>ӡѧ<D3A1><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void Savestudent(); //<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void Lookstudent(); //<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void Modifystudent(); //<2F><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void Readstudent(); //<2F><>ȡѧ<C8A1><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void Deletestudent(); //ɾ<><C9BE>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void yanshi(char *p); //<2F><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
|
|
|
|
|
//**********************************************************************************************
|
|
|
|
|
|
|
|
|
|
int count=0;
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
yanshi("\n\n\n\t\t**************************<2A><>ӭʹ<D3AD><CAB9>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>ϵͳ*****************\n");
|
|
|
|
|
system("cls");
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
system("color 2A"); //<2F><><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD>̨<EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
printf("\t\t\t*****************************************************************\n");
|
|
|
|
|
printf("\t\t\t|\t\t<EFBFBD><EFBFBD>ӭʹ<EFBFBD>ú<EFBFBD><EFBFBD>Ϲ<EFBFBD>ҵ<EFBFBD><EFBFBD>ѧѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ\t\t|\n");
|
|
|
|
|
printf("\t\t\t*****************************************************************\n");
|
|
|
|
|
printf("\t\t\t|\t\t\t<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t\t|***************************************************************|\n");
|
|
|
|
|
printf("\t\t\t|\t\t\t1.¼<><C2BC>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t\t|\t\t\t2.<2E><>ӡѧ<D3A1><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t\t|\t\t\t3.<2E><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t\t|\t\t\t4.<2E><>ȡѧ<C8A1><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t\t|\t\t\t5.<2E><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t\t|\t\t\t6.<2E><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t\t|\t\t\t7.ɾ<><C9BE>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t\t|\t\t\t0.<2E>˳<EFBFBD>ϵͳ\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t\t*****************************************************************\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\n");
|
|
|
|
|
char ch=getch(); //<2F>Ӽ<EFBFBD><D3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD>
|
|
|
|
|
switch(ch) //<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><F1A3ACB5>ò<EFBFBD>ͬ<EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
case '1': //¼<><C2BC>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
Inputstudent();
|
|
|
|
|
break;
|
|
|
|
|
case '2': //<2F><>ӡѧ<D3A1><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
Printstudent();
|
|
|
|
|
break;
|
|
|
|
|
case '3': //<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
Savestudent();
|
|
|
|
|
break;
|
|
|
|
|
case '4': //<2F><>ȡѧ<C8A1><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
Readstudent();
|
|
|
|
|
break;
|
|
|
|
|
case '5': //<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
Lookstudent();
|
|
|
|
|
break;
|
|
|
|
|
case '6': //<2F><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
Modifystudent();
|
|
|
|
|
break;
|
|
|
|
|
case '7': //ɾ<><C9BE>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
Deletestudent();
|
|
|
|
|
break;
|
|
|
|
|
case '0': //<2F>˳<EFBFBD>ϵͳ
|
|
|
|
|
system("cls");
|
|
|
|
|
yanshi("\n\n\n\n\n\t\t\t\tByeBye <20><>ӭ<EFBFBD>ٴ<EFBFBD>ʹ<EFBFBD>ã<EFBFBD>\n\n");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡\n\n");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
system("pause"); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ
|
|
|
|
|
system("cls"); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Inputstudent() //¼<><C2BC>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
{
|
|
|
|
|
system("cls"); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
system("color 6F"); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
node* pnewnode=(node*)malloc(sizeof(node)); //<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD>洢<EFBFBD>µ<EFBFBD>ѧ<EFBFBD><D1A7>
|
|
|
|
|
pnewnode->pnext=NULL;
|
|
|
|
|
//Ҫ<><D2AA><EFBFBD>½ڵ<C2BD><DAB5><EFBFBD><EFBFBD>뵽<EFBFBD><EBB5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if(phead==NULL)
|
|
|
|
|
{
|
|
|
|
|
phead=pnewnode;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pnewnode->pnext=phead;
|
|
|
|
|
phead=pnewnode;
|
|
|
|
|
}
|
|
|
|
|
printf("\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>\n");
|
|
|
|
|
scanf("%s",pnewnode->stu.num);
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",pnewnode->stu.name);
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",pnewnode->stu.sex);
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺\n");
|
|
|
|
|
scanf("%d",&pnewnode->stu.age);
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>գ<EFBFBD>\n");
|
|
|
|
|
scanf("%s",pnewnode->stu.birth);
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>סַ<EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",pnewnode->stu.home);
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD>绰<EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",pnewnode->stu.tel);
|
|
|
|
|
|
|
|
|
|
printf("\n¼<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ɹ<EFBFBD>!\n\n");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Printstudent() //<2F><>ӡѧ<D3A1><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 1A");
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
printf("\t\t|\t\t\t<EFBFBD><EFBFBD>ӭʹ<EFBFBD>ú<EFBFBD><EFBFBD>Ϲ<EFBFBD>ҵ<EFBFBD><EFBFBD>ѧѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
printf("\t\t|ѧ<><D1A7>\t|<7C><><EFBFBD><EFBFBD>\t|<7C>Ա<EFBFBD>\t|<7C><><EFBFBD><EFBFBD>\t|<7C><><EFBFBD><EFBFBD>\t|<7C><>ͥסַ\t\t|<7C><><EFBFBD>˵绰\t\t|\n");
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
node* p=phead; //<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ǰ<EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
while(p!=NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t|---------------------------------------------------------------------------------------|\n");
|
|
|
|
|
printf("\t\t|%s\t|%s\t|%s\t|%d\t|%s\t|%s\t\t|%s\t\t|\n",p->stu.num,p->stu.name,p->stu.sex,p->stu.age,p->stu.birth,p->stu.home,p->stu.tel);
|
|
|
|
|
p=p->pnext;
|
|
|
|
|
count++;
|
|
|
|
|
}
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: %d\t\t\t\n",count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Savestudent() //<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 1B");
|
|
|
|
|
FILE *fp;
|
|
|
|
|
fp=fopen("stu.dat","wb+"); //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
if(fp==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>\n\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
node* p=phead; //<2F><>ǰ<EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
while(p!=NULL)
|
|
|
|
|
{
|
|
|
|
|
fwrite(&p->stu,sizeof(student),1,fp);
|
|
|
|
|
p=p->pnext;
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("\n\n<EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!\n\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Lookstudent() //<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
{
|
|
|
|
|
char name[20];
|
|
|
|
|
char num[12];
|
|
|
|
|
char ch;
|
|
|
|
|
node* p=phead; //<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ǰ<EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
do{
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 2F");
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
printf("\t\t|\t\t\t<EFBFBD><EFBFBD>ӭʹ<EFBFBD>ú<EFBFBD><EFBFBD>Ϲ<EFBFBD>ҵ<EFBFBD><EFBFBD>ѧѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
printf("\t\t|\t\t\t\t<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҷ<EFBFBD>ʽ\t\t\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t|***************************************************************************************|\n");
|
|
|
|
|
printf("\t\t|\t\t\t\t1.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\t\t\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t|\t\t\t\t2.<2E><>ѧ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>\t\t\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t|\t\t\t\t0.<2E>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD>ϵͳ\t\t\t\t\t\t|\n");
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\n");
|
|
|
|
|
ch=getch(); //<2F>Ӽ<EFBFBD><D3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD>
|
|
|
|
|
switch(ch)
|
|
|
|
|
{
|
|
|
|
|
case '1': //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",name);
|
|
|
|
|
while(p!=NULL)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(p->stu.name,name)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
printf("\t\t|ѧ<><D1A7>\t|<7C><><EFBFBD><EFBFBD>\t|<7C>Ա<EFBFBD>\t|<7C><><EFBFBD><EFBFBD>\t|<7C><><EFBFBD><EFBFBD>\t|<7C><>ͥסַ\t\t|<7C><><EFBFBD>˵绰\t\t|\n");
|
|
|
|
|
printf("\t\t|---------------------------------------------------------------------------------------|\n");
|
|
|
|
|
printf("\t\t|%s\t|%s\t|%s\t|%d\t|%s\t|%s\t\t|%s\t\t|\n",p->stu.num,p->stu.name,p->stu.sex,p->stu.age,p->stu.birth,p->stu.home,p->stu.tel);
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
}
|
|
|
|
|
p=p->pnext;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case '2': //<2F><>ѧ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>\n");
|
|
|
|
|
scanf("%s",num);
|
|
|
|
|
while(p!=NULL)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(p->stu.num,num)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
printf("\t\t|ѧ<><D1A7>\t|<7C><><EFBFBD><EFBFBD>\t|<7C>Ա<EFBFBD>\t|<7C><><EFBFBD><EFBFBD>\t|<7C><><EFBFBD><EFBFBD>\t|<7C><>ͥסַ\t\t|<7C><><EFBFBD>˵绰\t\t|\n");
|
|
|
|
|
printf("\t\t|---------------------------------------------------------------------------------------|\n");
|
|
|
|
|
printf("\t\t|%s\t|%s\t|%s\t|%d\t|%s\t|%s\t\t|%s\t\t|\n",p->stu.num,p->stu.name,p->stu.sex,p->stu.age,p->stu.birth,p->stu.home,p->stu.tel);
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
}
|
|
|
|
|
p=p->pnext;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case '0': //<2F>˳<EFBFBD>ϵͳ
|
|
|
|
|
system("cls");
|
|
|
|
|
yanshi("\n\n\n\n\t\t\t\t\tByeBye <20><>ӭ<EFBFBD>ٴ<EFBFBD>ʹ<EFBFBD>ã<EFBFBD>\n\n");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡\n\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
while(ch!='0');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Modifystudent() //<2F><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 1B");
|
|
|
|
|
char name[20];
|
|
|
|
|
int j=0;
|
|
|
|
|
node* p=phead; //<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ǰ<EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĵ<EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",name);
|
|
|
|
|
while(p!=NULL)
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(p->stu.name,name)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
printf("\t\t|ѧ<><D1A7>\t|<7C><><EFBFBD><EFBFBD>\t|<7C>Ա<EFBFBD>\t|<7C><><EFBFBD><EFBFBD>\t|<7C><><EFBFBD><EFBFBD>\t|<7C><>ͥסַ\t\t|<7C><><EFBFBD>˵绰\t\t|\n");
|
|
|
|
|
printf("\t\t|---------------------------------------------------------------------------------------|\n");
|
|
|
|
|
printf("\t\t|%s\t|%s\t|%s\t|%d\t|%s\t|%s\t\t|%s\t\t|\n",p->stu.num,p->stu.name,p->stu.sex,p->stu.age,p->stu.birth,p->stu.home,p->stu.tel);
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>\n");
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>\n");
|
|
|
|
|
scanf("%s",p->stu.num);
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",p->stu.name);
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",p->stu.sex);
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺\n");
|
|
|
|
|
scanf("%d",&p->stu.age);
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>գ<EFBFBD>\n");
|
|
|
|
|
scanf("%s",p->stu.birth);
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>סַ<EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",p->stu.home);
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD>绰<EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",p->stu.tel);
|
|
|
|
|
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>\n\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
printf("\t\t|ѧ<><D1A7>\t|<7C><><EFBFBD><EFBFBD>\t|<7C>Ա<EFBFBD>\t|<7C><><EFBFBD><EFBFBD>\t|<7C><><EFBFBD><EFBFBD>\t|<7C><>ͥסַ\t\t|<7C><><EFBFBD>˵绰\t\t|\n");
|
|
|
|
|
printf("\t\t|---------------------------------------------------------------------------------------|\n");
|
|
|
|
|
printf("\t\t|%s\t|%s\t|%s\t|%d\t|%s\t|%s\t\t|%s\t\t|\n",p->stu.num,p->stu.name,p->stu.sex,p->stu.age,p->stu.birth,p->stu.home,p->stu.tel);
|
|
|
|
|
printf("\t\t*****************************************************************************************\n");
|
|
|
|
|
}
|
|
|
|
|
p=p->pnext;
|
|
|
|
|
j++;
|
|
|
|
|
}
|
|
|
|
|
if(j==0)
|
|
|
|
|
{
|
|
|
|
|
printf("û<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĵ<EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>\n\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Readstudent() //<2F><>ȡѧ<C8A1><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 0F");
|
|
|
|
|
FILE *fp;
|
|
|
|
|
fp=fopen("stu.dat","rb");
|
|
|
|
|
if(fp==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>\n\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
|
|
|
|
node* p=phead; //<2F><>ǰ<EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
while(p!=NULL)
|
|
|
|
|
{
|
|
|
|
|
fread(&p->stu,sizeof(student),1,fp);
|
|
|
|
|
printf("\t\t|%s\t|%s\t|%s\t|%d\t|%s\t|%s\t\t|%s\t\t|\n",p->stu.num,p->stu.name,p->stu.sex,p->stu.age,p->stu.birth,p->stu.home,p->stu.tel);
|
|
|
|
|
p=p->pnext;
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("\n\n<EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>!!!\n\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Deletestudent() //ɾ<><C9BE>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 6A");
|
|
|
|
|
char name[20];
|
|
|
|
|
int j=0;
|
|
|
|
|
node* p=phead; //<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ǰ<EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
node* p1=phead;
|
|
|
|
|
printf("\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",name);
|
|
|
|
|
while(strcmp(p->stu.name,name)!=0&&p!=NULL)
|
|
|
|
|
{
|
|
|
|
|
p1=p;
|
|
|
|
|
p=p->pnext;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(strcmp(p->stu.name,name)!=0)
|
|
|
|
|
{
|
|
|
|
|
if(p=phead)
|
|
|
|
|
{
|
|
|
|
|
phead=p->pnext;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
p1->pnext=p->pnext;
|
|
|
|
|
}
|
|
|
|
|
printf("ɾ<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>\n\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DZ<EFBFBD><EFBFBD>棡\n\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yanshi(char *p) //<2F><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
if (*p!=0)
|
|
|
|
|
printf("%c",*p++);
|
|
|
|
|
else
|
|
|
|
|
break;
|
|
|
|
|
Sleep(100); //<2F><>ʱ<EFBFBD><CAB1><EFBFBD>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|