|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <conio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
#define _X 35 //<2F><><EFBFBD><EFBFBD>x
|
|
|
|
|
#define _Y 5 //<2F><><EFBFBD><EFBFBD>y
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>ṹ<EFBFBD><E1B9B9>
|
|
|
|
|
typedef struct AbRecord{
|
|
|
|
|
int Y; //ȱ<><C8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>
|
|
|
|
|
int M; //<2F><>
|
|
|
|
|
int D; //<2F><>
|
|
|
|
|
char LNum[20]; //ȱ<>ν<EFBFBD><CEBD><EFBFBD>
|
|
|
|
|
char LName[50]; //<2F>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
char StuName[25]; //ѧ<><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int Type; //ȱ<><C8B1><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3>ٵ<EFBFBD><D9B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD>Σ<EFBFBD><CEA3><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
struct AbRecord *next; //ָ<><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>ָ<EFBFBD><D6B8>
|
|
|
|
|
}Record;
|
|
|
|
|
int LEN = sizeof(struct AbRecord); //<2F>ṹ<EFBFBD><E1B9B9><EFBFBD><EFBFBD>С
|
|
|
|
|
|
|
|
|
|
void AddStu(Record *head); //¼<><C2BC>ѧ<EFBFBD><D1A7>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void ChangeStu(Record *head); //<2F><EFBFBD>ѧ<EFBFBD><D1A7>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void LookupStu(Record *head); //<2F><><EFBFBD><EFBFBD>ij<EFBFBD><C4B3>ѧ<EFBFBD><D1A7>ȱ<EFBFBD>μ<EFBFBD>¼
|
|
|
|
|
void DeleteStu(Record *head);
|
|
|
|
|
void CountStuRecord(Record suit[100], int m); //ͳ<><CDB3>ij<EFBFBD><C4B3>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD>ѧ<EFBFBD><D1A7>
|
|
|
|
|
void CountClassRecord(Record suit[100], int m); //ͳ<><CDB3>ij<EFBFBD><C4B3>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD>εĿγ<C4BF>
|
|
|
|
|
void gotoxy(int x, int y); //<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD>
|
|
|
|
|
void ShowRecord(Record *p); //<2F><>ʾ<EFBFBD><CABE>¼
|
|
|
|
|
Record* Fread(); //<2F><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>Ϣд<CFA2><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void Fwrite(Record* head); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
void SuitTime(Record *head, char ch); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>εļ<CEB5>¼
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
FILE *fp;
|
|
|
|
|
if((fp = fopen("record.txt", "a")) == NULL)
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD><EFBFBD>");
|
|
|
|
|
fclose(fp);
|
|
|
|
|
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color F0");
|
|
|
|
|
printf("\n\n\n\n");
|
|
|
|
|
printf("\t\t\t\t\t<EFBFBD><EFBFBD>------<2D><>-------ӭ------ʹ------<2D><>------<2D><>\n\n");
|
|
|
|
|
printf("\t\t\t\t\t --------<2D><>1<EFBFBD><31>¼<EFBFBD><C2BC>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD>Ϣ-----------\n\n");
|
|
|
|
|
printf("\t\t\t\t\t --------<2D><>2<EFBFBD><32><EFBFBD><EFBFBD>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD>Ϣ-----------\n\n");
|
|
|
|
|
printf("\t\t\t\t\t --------<2D><>3<EFBFBD><33><EFBFBD><EFBFBD>ѯȱ<D1AF>μ<EFBFBD>¼-----------\n\n");
|
|
|
|
|
printf("\t\t\t\t\t --------<2D><>4<EFBFBD><34>ɾ<EFBFBD><C9BE>ȱ<EFBFBD>μ<EFBFBD>¼-----------\n\n");
|
|
|
|
|
printf("\t\t\t\t\t --------<2D><>5<EFBFBD><35>ѧ<EFBFBD><D1A7>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-----------\n\n");
|
|
|
|
|
printf("\t\t\t\t\t --------<2D><>6<EFBFBD><36><EFBFBD>γ<EFBFBD>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-----------\n\n");
|
|
|
|
|
printf("\t\t\t\t\t --------<2D><>0<EFBFBD><30><EFBFBD>˳<EFBFBD>ϵͳ----------------\n\n");
|
|
|
|
|
printf("\t\t\t\t\t<EFBFBD><EFBFBD>--------<2D><>--<2D><>--<2D><>--<2D><>--ϵ--ͳ---------<2D><>\n\n\n");
|
|
|
|
|
printf("\t\t\t\t\t\t\t<EFBFBD><EFBFBD> <20><>");
|
|
|
|
|
|
|
|
|
|
//<2F><>ȡ<EFBFBD>û<EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
gotoxy(_X+24, _Y+18);
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
char ch = getch();
|
|
|
|
|
|
|
|
|
|
Record *head = Fread(); //<2F><>ȡ<EFBFBD><C8A1>ͷ
|
|
|
|
|
switch(ch)
|
|
|
|
|
{
|
|
|
|
|
case '0':
|
|
|
|
|
return 0;
|
|
|
|
|
case '1' :
|
|
|
|
|
AddStu(head);
|
|
|
|
|
break;
|
|
|
|
|
case '2' :
|
|
|
|
|
ChangeStu(head);
|
|
|
|
|
break;
|
|
|
|
|
case '3' :
|
|
|
|
|
LookupStu(head);
|
|
|
|
|
break;
|
|
|
|
|
case '4' :
|
|
|
|
|
DeleteStu(head);
|
|
|
|
|
break;
|
|
|
|
|
case '5':
|
|
|
|
|
SuitTime(head, ch);
|
|
|
|
|
break;
|
|
|
|
|
case '6':
|
|
|
|
|
SuitTime(head, ch);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD>
|
|
|
|
|
void gotoxy(int x, int y)
|
|
|
|
|
{
|
|
|
|
|
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
|
|
|
COORD pos;
|
|
|
|
|
pos.X = x;
|
|
|
|
|
pos.Y = y;
|
|
|
|
|
SetConsoleCursorPosition(handle, pos);
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Record* Fread()
|
|
|
|
|
{
|
|
|
|
|
Record *head =NULL, *last, *p;
|
|
|
|
|
|
|
|
|
|
FILE *fa;
|
|
|
|
|
if((fa = fopen("record.txt", "r")) == NULL)
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD><EFBFBD>");
|
|
|
|
|
while(!feof(fa))
|
|
|
|
|
{
|
|
|
|
|
if((p = (Record*)malloc(LEN)) == NULL)
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
|
|
|
|
|
if(fread(p, LEN, 1, fa) == 1)
|
|
|
|
|
{
|
|
|
|
|
if(head == NULL)
|
|
|
|
|
{
|
|
|
|
|
head = p;
|
|
|
|
|
last = p;
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
last->next = p;
|
|
|
|
|
last = p;
|
|
|
|
|
last->next = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
fclose(fa);
|
|
|
|
|
return head;
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD>
|
|
|
|
|
void Fwrite(Record* head)
|
|
|
|
|
{
|
|
|
|
|
Record *p;
|
|
|
|
|
|
|
|
|
|
FILE *fb;
|
|
|
|
|
if((fb = fopen("record.txt", "w")) == NULL)
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD><EFBFBD>");
|
|
|
|
|
for(p=head; p; p=p->next)
|
|
|
|
|
{
|
|
|
|
|
if(fwrite(p, LEN, 1, fb) != 1)
|
|
|
|
|
printf("д<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
fclose(fb);
|
|
|
|
|
}
|
|
|
|
|
//¼<><C2BC>ѧ<EFBFBD><D1A7>ȱ<EFBFBD>μ<EFBFBD>¼
|
|
|
|
|
void AddStu(Record *head)
|
|
|
|
|
{
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
char ch1; //ȷ<><C8B7><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD>
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\n\t\t\t\t\t\t¼<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>ȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ");
|
|
|
|
|
printf("\n\n\n\t\t\t\tѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\n\t\t\t\tȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD> <20><> <20><> <20><> ");
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\n\t\t\t\tȱ<EFBFBD>νڴΣ<EFBFBD> <20><><EFBFBD>磺<EFBFBD><E7A3BA><EFBFBD>߰˽ڣ<CBBD>");
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\n\t\t\t\t<EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD> <20><><EFBFBD>磺<EFBFBD><E7A3BA>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ");
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\n\t\t\t\tȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD> <20><> <20><>");
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\n\t\t\t\t<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD>ٵ<EFBFBD> <20><>2<EFBFBD><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>3<EFBFBD><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>4<EFBFBD><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\n\t\t\t\t <20><> <20><>");
|
|
|
|
|
printf("\n\n\t\t\t\t<EFBFBD><EFBFBD>0<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>¼<EFBFBD>뷵<EFBFBD>ز˵<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>¼<EFBFBD><C2BC>");
|
|
|
|
|
|
|
|
|
|
//************************************<2A><><EFBFBD><EFBFBD>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD>Ϣ***************************
|
|
|
|
|
Record *p = (Record*)malloc(LEN), *q = head; //<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>½ڵ<C2BD>
|
|
|
|
|
gotoxy(_X+7, _Y-1); scanf("%s", p->StuName); //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
gotoxy(_X+7, _Y+2); scanf("%d", &p->Y); //<2F><>
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
gotoxy(_X+16, _Y+2); scanf("%d", &p->M); //<2F><>
|
|
|
|
|
if(p->M>0 && p->M<13)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t\t\t\t\t\t\t\t\t\t ");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
printf("\t\t\t\t\t\t\t\t\t\t\t<EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
gotoxy(_X+16, _Y+2); printf(" ");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
gotoxy(_X+24, _Y+2); scanf("%d", &p->D); //<2F><>
|
|
|
|
|
if(p->D>0 && p->D<32)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t\t\t\t\t\t\t\t\t\t ");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t\t\t\t\t\t\t\t\t\t<EFBFBD>շ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
gotoxy(_X+24, _Y+2); printf(" ");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
gotoxy(_X+7, _Y+5); scanf("%s", p->LNum); //<2F>γ̽ڴ<CCBD>
|
|
|
|
|
gotoxy(_X+7, _Y+8); scanf("%s", p->LName); //<2F>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
gotoxy(_X+14, _Y+11); char typee = getch(); //ѡ<><D1A1>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
gotoxy(_X+14, _Y+11); printf("%c", typee);
|
|
|
|
|
p->Type = typee - '0';
|
|
|
|
|
if(p->Type>0 && p->Type<5)
|
|
|
|
|
break;
|
|
|
|
|
else
|
|
|
|
|
printf("\n\t\t\t\tѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
p->next = NULL;
|
|
|
|
|
|
|
|
|
|
gotoxy(_X+18, _Y+16); char ch=getch(); //ȷ<><C8B7><EFBFBD>Ƿ<EFBFBD>¼<EFBFBD><C2BC>
|
|
|
|
|
|
|
|
|
|
if(ch!='0')
|
|
|
|
|
{
|
|
|
|
|
if(head == NULL)
|
|
|
|
|
head = p;
|
|
|
|
|
else{
|
|
|
|
|
while(q->next) //<2F>ҵ<EFBFBD><D2B5><EFBFBD>β
|
|
|
|
|
{
|
|
|
|
|
q = q->next;
|
|
|
|
|
}
|
|
|
|
|
q->next = p;
|
|
|
|
|
q=p; //<2F><><EFBFBD><EFBFBD><EFBFBD>½ڵ<C2BD>
|
|
|
|
|
q->next = NULL;
|
|
|
|
|
}
|
|
|
|
|
Fwrite(head);
|
|
|
|
|
system("cls");
|
|
|
|
|
ShowRecord(p);
|
|
|
|
|
printf("\n\t\t\t\t<EFBFBD><EFBFBD>Ϣ¼<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>........<2E><>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>Ϣ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ز˵<D8B2>");
|
|
|
|
|
gotoxy(_X+18, _Y+16); ch1 = getch();
|
|
|
|
|
}
|
|
|
|
|
if(ch1 != '1') //ȷ<><C8B7><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD>
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//<2F><EFBFBD>ѧ<EFBFBD><D1A7>ȱ<EFBFBD>μ<EFBFBD>¼
|
|
|
|
|
void ChangeStu(Record *head)
|
|
|
|
|
{
|
|
|
|
|
char ch1; //ȷ<><C8B7><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>
|
|
|
|
|
char stuName[25];
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\n\t\t\t\t\t\t<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>ȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ");
|
|
|
|
|
printf("\n\n\t\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
gotoxy(_X+11, _Y-2); scanf("%s", stuName);
|
|
|
|
|
|
|
|
|
|
Record *q;
|
|
|
|
|
int num=0, count=0; //<2F><>ѧ<EFBFBD><D1A7>ȱ<EFBFBD>μ<EFBFBD>¼<EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
for(q=head; q; q=q->next)
|
|
|
|
|
if(strcmp(q->StuName, stuName) == 0)
|
|
|
|
|
{
|
|
|
|
|
num++;
|
|
|
|
|
printf("\n\t\t\t\t******************<2A><>%d<><64>******************", num);
|
|
|
|
|
ShowRecord(q);
|
|
|
|
|
}
|
|
|
|
|
if(num>0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĸ<EFBFBD>ѧ<EFBFBD><EFBFBD>ȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Σ<EFBFBD>");
|
|
|
|
|
char No = getch();
|
|
|
|
|
for(q=head; q; q = q->next) //<2F><><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(q->StuName, stuName) == 0)
|
|
|
|
|
{
|
|
|
|
|
count++;
|
|
|
|
|
if(count == No-'0')
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\n\t\t\t\t<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>");
|
|
|
|
|
ShowRecord(q);
|
|
|
|
|
printf("\n\t\t\t\tѡ<EFBFBD><EFBFBD>Ҫ<EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>Ϣ <20><> <20><>");
|
|
|
|
|
printf("\n\n\t<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>2<EFBFBD><32>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>3<EFBFBD><33>ȱ<EFBFBD>νڴ<CEBD> <20><>4<EFBFBD><34><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD> <20><>5<EFBFBD><35>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD>ز˵<D8B2>");
|
|
|
|
|
gotoxy(_X+18, _Y+13); char ch = getch(); //ѡ<><D1A1><EFBFBD>ĵ<DEB8><C4B5><EFBFBD>Ŀ
|
|
|
|
|
gotoxy(_X+18, _Y+13); printf("%c", ch);
|
|
|
|
|
|
|
|
|
|
//*********************<2A><><EFBFBD><EFBFBD><EFBFBD>ĵ<DEB8><C4B5><EFBFBD>Ϣ*********************
|
|
|
|
|
|
|
|
|
|
switch(ch)
|
|
|
|
|
{
|
|
|
|
|
case '0':
|
|
|
|
|
return;
|
|
|
|
|
case '1' :
|
|
|
|
|
printf("\n\n\n\n\t\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
gotoxy(_X+10, _Y+17); scanf("%s", q->StuName);
|
|
|
|
|
break;
|
|
|
|
|
case '2' :
|
|
|
|
|
printf("\n\n\n\n\t\t\t\tȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD> <20><> <20><> <20><> ");
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
gotoxy(_X+7, _Y+17); scanf("%d", &q->Y);
|
|
|
|
|
gotoxy(_X+15, _Y+17); scanf("%d", &q->M);
|
|
|
|
|
gotoxy(_X+23, _Y+17); scanf("%d", &q->D);
|
|
|
|
|
break;
|
|
|
|
|
case '3' :
|
|
|
|
|
printf("\n\n\n\n\t\t\t\tȱ<EFBFBD>νڴΣ<EFBFBD> <20><><EFBFBD>磺<EFBFBD><E7A3BA><EFBFBD>߰˽ڣ<CBBD>");
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
gotoxy(_X+6, _Y+17); scanf("%s", q->LNum);
|
|
|
|
|
break;
|
|
|
|
|
case '4' :
|
|
|
|
|
printf("\n\n\n\n\t\t\t\tȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD> <20><><EFBFBD>磺<EFBFBD><E7A3BA>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ");
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
gotoxy(_X+6, _Y+17); scanf("%s", q->LName);
|
|
|
|
|
break;
|
|
|
|
|
case '5' :
|
|
|
|
|
printf("\n\n\n\n\t\t\t\tȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD> <20><> <20><>");
|
|
|
|
|
printf("\n\n\t\t\t\t<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD>ٵ<EFBFBD> <20><>2<EFBFBD><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>3<EFBFBD><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>4<EFBFBD><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
gotoxy(_X+14, _Y+17); char typee = getch(); //ѡ<><D1A1>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
gotoxy(_X+14, _Y+17); printf("%c", typee);
|
|
|
|
|
q->Type = typee - '0';
|
|
|
|
|
if(q->Type>0 && q->Type<5)
|
|
|
|
|
break;
|
|
|
|
|
else
|
|
|
|
|
printf("\n\t\t\t\tѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\n\n\t\t\t\t<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>");
|
|
|
|
|
ShowRecord(q);
|
|
|
|
|
printf("\n\n\t\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD> <20><>0<EFBFBD><30>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ز˵<D8B2>........ ");
|
|
|
|
|
gotoxy(_X+38, _Y+15); ch1 = getch(); //ȷ<><C8B7><EFBFBD><EFBFBD>
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else{ //<2F><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD>ļ<EFBFBD>¼
|
|
|
|
|
printf("\n\t\t\t\t\t<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d<><64>ȱ<EFBFBD>μ<EFBFBD>¼", num);
|
|
|
|
|
printf("\n\n\t\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ز˵<EFBFBD>........ ");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ch1 != '0')
|
|
|
|
|
{
|
|
|
|
|
Fwrite(head);
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//<2F><>ʾ<EFBFBD><CABE>¼
|
|
|
|
|
void ShowRecord(Record *p)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\n\n\t\t\t\tѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s", p->StuName);
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\n\t\t\t\tȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>%d <20><> %d <20><> %d <20><> ", p->Y, p->M, p->D);
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\n\t\t\t\tȱ<EFBFBD>νڴΣ<EFBFBD>%s ", p->LNum);
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\n\t\t\t\tȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>%s ", p->LName);
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
char *s;
|
|
|
|
|
if(p->Type == 1)
|
|
|
|
|
s = "<EFBFBD>ٵ<EFBFBD>";
|
|
|
|
|
if(p->Type == 2)
|
|
|
|
|
s = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|
|
|
|
if(p->Type == 3)
|
|
|
|
|
s = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|
|
|
|
if(p->Type == 4)
|
|
|
|
|
s = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|
|
|
|
printf("\n\n\t\t\t\tȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>%s", s);
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//<2F><>ѯѧ<D1AF><D1A7><EFBFBD><EFBFBD>¼
|
|
|
|
|
void LookupStu(Record *head)
|
|
|
|
|
{
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
char stuName[25];
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\n\t\t\t\t\t\t<EFBFBD><EFBFBD>ѯѧ<EFBFBD><EFBFBD>ȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ");
|
|
|
|
|
printf("\n\n\t\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
gotoxy(_X+11, _Y-2); scanf("%s", stuName);
|
|
|
|
|
|
|
|
|
|
int key =0 ; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB4><EFBFBD>
|
|
|
|
|
Record *q;
|
|
|
|
|
for(q=head; q; q = q->next) //<2F><><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(q->StuName, stuName) == 0)
|
|
|
|
|
{
|
|
|
|
|
key++;
|
|
|
|
|
printf("\n\t\t\t\t***************************<2A><>%d<><64>****************************", key);
|
|
|
|
|
ShowRecord(q);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("\n\t\t\t\t*********************************************************************");
|
|
|
|
|
if(key == 0)
|
|
|
|
|
printf("\n\t\t\t\t<EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>ȱ<EFBFBD>μ<EFBFBD>¼");
|
|
|
|
|
printf("\n\n\t\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ <20><>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD>ز˵<D8B2>");
|
|
|
|
|
printf("\n\n\t\t\t\t........");
|
|
|
|
|
char ch = getch();
|
|
|
|
|
if(ch == '0')
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//ɾ<><C9BE>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>¼
|
|
|
|
|
void DeleteStu(Record *head)
|
|
|
|
|
{
|
|
|
|
|
char ch1; //ȷ<><C8B7><EFBFBD>Ƿ<EFBFBD>ɾ<EFBFBD><C9BE>
|
|
|
|
|
char stuName[25];
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\n\t\t\t\t\t\t<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>ȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ");
|
|
|
|
|
printf("\n\n\t\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\t\t\t\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
gotoxy(_X+11, _Y-2); scanf("%s", stuName);
|
|
|
|
|
|
|
|
|
|
Record *q, *p;
|
|
|
|
|
int num=0, count=0; //<2F><>ѧ<EFBFBD><D1A7>ȱ<EFBFBD>μ<EFBFBD>¼<EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
for(q=head; q; q=q->next)
|
|
|
|
|
if(strcmp(q->StuName, stuName) == 0)
|
|
|
|
|
{
|
|
|
|
|
num++;
|
|
|
|
|
printf("\n\t\t\t\t******************<2A><>%d<><64>******************", num); //<2F>ҵ<EFBFBD><D2B5><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
ShowRecord(q);
|
|
|
|
|
}
|
|
|
|
|
if(num>0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĸ<EFBFBD>ѧ<EFBFBD><EFBFBD>ȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Σ<EFBFBD>");
|
|
|
|
|
char No = getch();
|
|
|
|
|
for(q=head; q; q = q->next) //<2F><><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(q->StuName, stuName) == 0)
|
|
|
|
|
{
|
|
|
|
|
count++;
|
|
|
|
|
if(count == No-'0') //<2F>ҵ<EFBFBD><D2B5>ýڵ<C3BD>
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
ShowRecord(q);
|
|
|
|
|
printf("\n\t\t\t\t<EFBFBD><EFBFBD>0<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ز˵<EFBFBD> ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>ɾ<EFBFBD><C9BE>........");
|
|
|
|
|
ch1 = getch();
|
|
|
|
|
if(q == head) //Ҫɾ<D2AA><C9BE><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>ͷ
|
|
|
|
|
{
|
|
|
|
|
printf("*******************ͷ");
|
|
|
|
|
head = q->next;
|
|
|
|
|
free(q);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if(q->next == NULL) //Ҫɾ<D2AA><C9BE><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>β
|
|
|
|
|
{
|
|
|
|
|
printf("***************β<><CEB2>");
|
|
|
|
|
p->next =NULL;
|
|
|
|
|
free(q);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
p->next = q->next;
|
|
|
|
|
free(q);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
p = q;
|
|
|
|
|
}
|
|
|
|
|
if(ch1!='0')
|
|
|
|
|
{
|
|
|
|
|
Fwrite(head); //<2F><><EFBFBD><EFBFBD><EFBFBD>ĺ<DEB8><C4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
printf("\n\t\t\t\tɾ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>! <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..........");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
printf("\n\t\t\t\t\t<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d<><64>ȱ<EFBFBD>μ<EFBFBD>¼", num); //û<>ҵ<EFBFBD>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
printf("\n\n\t\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ز˵<EFBFBD>........ ");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//ͳ<><CDB3>ij<EFBFBD><C4B3>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD>ѧ<EFBFBD><D1A7>,
|
|
|
|
|
void SuitTime(Record *head, char ch)
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int y1, y2, m1, m2, d1, d2;
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n\n <20><> <20><> <20><>->");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
printf("\n <20><> <20><> <20><>");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
gotoxy(_X-34, _Y-2); scanf("%d", &y1);
|
|
|
|
|
gotoxy(_X-24, _Y-2); scanf("%d", &m1);
|
|
|
|
|
gotoxy(_X-16, _Y-2); scanf("%d", &d1);
|
|
|
|
|
gotoxy(_X-34, _Y); scanf("%d", &y2);
|
|
|
|
|
gotoxy(_X-24, _Y); scanf("%d", &m2);
|
|
|
|
|
gotoxy(_X-16, _Y); scanf("%d", &d2);
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ㲢<DAB5><E3B2A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Record *p, suit[100];
|
|
|
|
|
int m = 0;
|
|
|
|
|
for(p=head; p; p=p->next)
|
|
|
|
|
{
|
|
|
|
|
if(p->Type == 3) //<2F><><EFBFBD>ε<EFBFBD>ѧ<EFBFBD><D1A7>
|
|
|
|
|
{
|
|
|
|
|
if(p->Y < y1 || p->Y>y2) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
continue;
|
|
|
|
|
else{
|
|
|
|
|
if( (p->M<m1 && p->Y==y1) || (p->M>y2 && p->Y==y2)) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
continue;
|
|
|
|
|
else{
|
|
|
|
|
if( (p->M==m1 && p->Y==y1 && p->D<d1)|| (p->M==y2 && p->Y==y2 && p->D>d2)) //ͬ<><CDAC>ͬ<EFBFBD><CDAC><EFBFBD>շֲ<D5B7><D6B2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
continue;
|
|
|
|
|
else{
|
|
|
|
|
suit[m].Y=p->Y; suit[m].M=p->M; suit[m].D=p->D;
|
|
|
|
|
strcpy(suit[m].StuName, p->StuName);
|
|
|
|
|
strcpy(suit[m].LName, p->LName);
|
|
|
|
|
strcpy(suit[m].LNum, p->LNum);
|
|
|
|
|
suit[m].Type=p->Type;
|
|
|
|
|
m++;
|
|
|
|
|
// printf("***%s", suit[0].StuName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(ch == '5')
|
|
|
|
|
CountStuRecord(suit, m);
|
|
|
|
|
if(ch == '6')
|
|
|
|
|
CountClassRecord(suit, m);
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void CountStuRecord(Record suit[100], int m)
|
|
|
|
|
{
|
|
|
|
|
int i, j, a[100]={0}, sum;
|
|
|
|
|
for(i=0; i<m; i++)
|
|
|
|
|
{
|
|
|
|
|
sum=1;
|
|
|
|
|
if(suit[i].Type != 0) //δ<><CEB4>ͳ<EFBFBD>ƹ<EFBFBD><C6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
for(j=i+1; j<m; j++) //ͳ<><CDB3><EFBFBD><EFBFBD><EFBFBD>ֳ<EFBFBD><D6B3>ֵĴ<D6B5><C4B4><EFBFBD>
|
|
|
|
|
if(strcmp(suit[i].StuName, suit[j].StuName) == 0)
|
|
|
|
|
{
|
|
|
|
|
sum++;
|
|
|
|
|
suit[j].Type = 0;
|
|
|
|
|
}
|
|
|
|
|
a[i] = sum;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int t; Record tt;
|
|
|
|
|
for(i=0; i<m; i++)
|
|
|
|
|
{
|
|
|
|
|
if(a[i]!=0)
|
|
|
|
|
{
|
|
|
|
|
for(j=i+1; j<m; j++)
|
|
|
|
|
{
|
|
|
|
|
if(a[i]<a[j])
|
|
|
|
|
{
|
|
|
|
|
t = a[i];
|
|
|
|
|
a[i] = a[j];
|
|
|
|
|
a[j] = t;
|
|
|
|
|
|
|
|
|
|
tt = suit[i];
|
|
|
|
|
suit[i] = suit[j];
|
|
|
|
|
suit[j] = tt;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gotoxy(0, 0);
|
|
|
|
|
printf("\n\t\t\t\t\t**********************************");
|
|
|
|
|
printf("\n\t\t\t\t\t* <20><><EFBFBD><EFBFBD> <20><><EFBFBD>δ<EFBFBD><CEB4><EFBFBD> *");
|
|
|
|
|
printf("\n\t\t\t\t\t**********************************");
|
|
|
|
|
for(i=0; i<m; i++)
|
|
|
|
|
{
|
|
|
|
|
if(a[i]!=0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\n\t\t\t %-15s %-5d", suit[i].StuName, a[i]);
|
|
|
|
|
printf("\n\t\t\t\t\t**********************************");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("\n\n\t\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ز˵<EFBFBD>..........");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD>տ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void CountClassRecord(Record suit[100], int m)
|
|
|
|
|
{
|
|
|
|
|
int i, j, a[100]={0}, sum;
|
|
|
|
|
for(i=0; i<m; i++)
|
|
|
|
|
{
|
|
|
|
|
sum=1;
|
|
|
|
|
if(suit[i].Type != 0) //δ<><CEB4>ͳ<EFBFBD>ƹ<EFBFBD><C6B9>Ŀ<EFBFBD>Ŀ
|
|
|
|
|
{
|
|
|
|
|
for(j=i+1; j<m; j++) //ͳ<>ƿ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>ֵĴ<D6B5><C4B4><EFBFBD>
|
|
|
|
|
if(strcmp(suit[i].LName, suit[j].LName) == 0)
|
|
|
|
|
{
|
|
|
|
|
sum++;
|
|
|
|
|
suit[j].Type = 0;
|
|
|
|
|
}
|
|
|
|
|
a[i] = sum;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int t; Record tt;
|
|
|
|
|
for(i=0; i<m; i++)
|
|
|
|
|
{
|
|
|
|
|
if(a[i]!=0)
|
|
|
|
|
{
|
|
|
|
|
for(j=i+1; j<m; j++)
|
|
|
|
|
{
|
|
|
|
|
if(a[i]<a[j])
|
|
|
|
|
{
|
|
|
|
|
t = a[i];
|
|
|
|
|
a[i] = a[j];
|
|
|
|
|
a[j] = t;
|
|
|
|
|
|
|
|
|
|
tt = suit[i];
|
|
|
|
|
suit[i] = suit[j];
|
|
|
|
|
suit[j] = tt;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gotoxy(0, 0);
|
|
|
|
|
printf("\n\t\t\t\t\t **********************************");
|
|
|
|
|
printf("\n\t\t\t\t\t * <20><>Ŀ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *");
|
|
|
|
|
printf("\n\t\t\t\t\t **********************************");
|
|
|
|
|
for(i=0; i<m; i++)
|
|
|
|
|
{
|
|
|
|
|
if(a[i]!=0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\n\t\t\t %-15s %-5d", suit[i].LName, a[i]);
|
|
|
|
|
printf("\n\t\t\t\t\t **********************************");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("\n\n\t\t\t\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ز˵<EFBFBD>..........");
|
|
|
|
|
getch();
|
|
|
|
|
}
|