|
|
|
|
#include<stdio.h>
|
|
|
|
|
#include<string.h>
|
|
|
|
|
#include<stdlib.h>
|
|
|
|
|
#include<malloc.h>
|
|
|
|
|
void prin1();
|
|
|
|
|
void choose();
|
|
|
|
|
typedef struct subjects //<2F><><EFBFBD><EFBFBD><EFBFBD>γ<EFBFBD><CEB3><EFBFBD>Ϣ<EFBFBD>ṹ<EFBFBD><E1B9B9>
|
|
|
|
|
{
|
|
|
|
|
int num; //<2F>γ̱<CEB3><CCB1><EFBFBD>
|
|
|
|
|
char name[20]; //<2F>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
char kind[10];//<2F>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int stime;//<2F><>ѧʱ
|
|
|
|
|
int ttime;//<2F>ڿ<EFBFBD>ѧʱ
|
|
|
|
|
int etime;//ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD>ϻ<EFBFBD>ѧʱ
|
|
|
|
|
int score;//ѧ<><D1A7>
|
|
|
|
|
int term;//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>
|
|
|
|
|
struct subjects *next;
|
|
|
|
|
} SUB;
|
|
|
|
|
SUB *head=NULL;
|
|
|
|
|
//<2F><><EFBFBD>涨<EFBFBD><E6B6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
SUB *create_form()
|
|
|
|
|
{
|
|
|
|
|
SUB *head,*tail,*p;//<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD>ڵ㣬β<E3A3AC>ڵ㣬<DAB5>м<EFBFBD><D0BC>ڵ㡣
|
|
|
|
|
int num,stime,ttime;
|
|
|
|
|
int etime,score,term;
|
|
|
|
|
char name[20],kind[10];
|
|
|
|
|
int size=sizeof(SUB);
|
|
|
|
|
head=tail=NULL;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>γ<EFBFBD><EFBFBD><EFBFBD>Ϣ:\n");
|
|
|
|
|
scanf("%d%s%s%d%d%d%d%d",&num,name,kind,&stime,&ttime,&etime,&score,&term);
|
|
|
|
|
while(num!=0)
|
|
|
|
|
{
|
|
|
|
|
p=(SUB *)malloc(size);
|
|
|
|
|
p->num=num;
|
|
|
|
|
strcpy(p->name,name);
|
|
|
|
|
strcpy(p->kind,kind);
|
|
|
|
|
p->stime=stime;
|
|
|
|
|
p->ttime=ttime;
|
|
|
|
|
p->etime=etime;
|
|
|
|
|
p->score=score;
|
|
|
|
|
p->term=term;
|
|
|
|
|
if(head==NULL)
|
|
|
|
|
head=p;
|
|
|
|
|
else
|
|
|
|
|
tail->next=p;
|
|
|
|
|
tail=p;
|
|
|
|
|
scanf("%d%s%s%d%d%d%d%d",&num,name,kind,&stime,&ttime,&etime,&score,&term);
|
|
|
|
|
}
|
|
|
|
|
tail->next=NULL;
|
|
|
|
|
return head;
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
void savefile() //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
SUB *p;
|
|
|
|
|
FILE *fp;fp=fopen("2.txt","w");
|
|
|
|
|
if(fp==NULL)exit(0);
|
|
|
|
|
printf("<EFBFBD>γ̱<EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20><>ѧʱ <20>ڿ<EFBFBD>ѧʱ ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>ѧʱ ѧ<><D1A7> <20><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>\n");
|
|
|
|
|
for(p=head;p;p=p->next)
|
|
|
|
|
fprintf(fp,"%5d%12s%9s%9d%9d%11d%11d%7d\n",p->num,p->name,p->kind,p->stime,p->ttime,p->etime,p->score,p->term);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ѷ<EFBFBD><EFBFBD><EFBFBD>'2.txt'<27>ļ<EFBFBD><C4BC><EFBFBD>\n");
|
|
|
|
|
system("pause");}
|
|
|
|
|
void savefile1()
|
|
|
|
|
{
|
|
|
|
|
SUB *p;
|
|
|
|
|
FILE *fp;fp=fopen("3.txt","w");
|
|
|
|
|
if(fp==NULL)exit(0);
|
|
|
|
|
for(p=head;p;p=p->next)
|
|
|
|
|
fprintf(fp,"%5d%12s%9s%9d%9d%11d%11d%7d\n",p->num,p->name,p->kind,p->stime,p->ttime,p->etime,p->score,p->term);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ѷ<EFBFBD><EFBFBD><EFBFBD>'3.txt'<27>ļ<EFBFBD><C4BC><EFBFBD>\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//<2F><>ȡ<EFBFBD>ļ<EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
void readfile()//<2F>Ķ<EFBFBD><C4B6>ļ<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
void *myInsert(SUB*);
|
|
|
|
|
SUB *newSub;//<2F>¿γ<C2BF>
|
|
|
|
|
int num,stime,ttime,etime;
|
|
|
|
|
int score,term;
|
|
|
|
|
char c,name[20],kind[10],fname[20];
|
|
|
|
|
FILE *fp;
|
|
|
|
|
fp=fopen("2.txt","r");
|
|
|
|
|
while(!feof(fp))
|
|
|
|
|
{
|
|
|
|
|
newSub=(SUB*)malloc(sizeof(SUB));
|
|
|
|
|
fscanf(fp,"%d%s%s%d%d%d%d%d\n",&newSub->num,newSub->name,newSub->kind,&newSub->stime,&newSub->ttime,&newSub->etime,&newSub->score,&newSub->term);
|
|
|
|
|
myInsert(newSub);
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
}
|
|
|
|
|
void read()
|
|
|
|
|
{
|
|
|
|
|
void *myInsert(SUB*);
|
|
|
|
|
SUB *newSub;//<2F>¿γ<C2BF>
|
|
|
|
|
int num,stime,ttime,etime;
|
|
|
|
|
int score,term;
|
|
|
|
|
char c,name[20],kind[10],fname[20];
|
|
|
|
|
FILE *fp;
|
|
|
|
|
fp=fopen("3.txt","r");
|
|
|
|
|
while(!feof(fp))
|
|
|
|
|
{
|
|
|
|
|
newSub=(SUB*)malloc(sizeof(SUB));
|
|
|
|
|
fscanf(fp,"%d%s%s%d%d%d%d%d\n",&newSub->num,newSub->name,newSub->kind,&newSub->stime,&newSub->ttime,&newSub->etime,&newSub->score,&newSub->term);
|
|
|
|
|
myInsert(newSub);
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD>涨<EFBFBD><E6B6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
void prin()
|
|
|
|
|
{
|
|
|
|
|
SUB *ptr;
|
|
|
|
|
head=NULL;
|
|
|
|
|
readfile();
|
|
|
|
|
if(head==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\n\t**********NO RECORDS!**********\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD>γ̱<EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20><>ѧʱ <20>ڿ<EFBFBD>ѧʱ ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>ѧʱ ѧ<><D1A7> <20><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>\n");
|
|
|
|
|
for(ptr=head;ptr;ptr=ptr->next)
|
|
|
|
|
{
|
|
|
|
|
printf("%5d%12s%9s%9d%9d%11d%11d%7d\n",ptr->num,ptr->name,ptr->kind,ptr->stime,ptr->ttime,ptr->etime,ptr->score,ptr->term);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
system("pause");
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD>涨<EFBFBD><E6B6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>γ<DEBF>ģ<EFBFBD><C4A3>
|
|
|
|
|
void prin1()
|
|
|
|
|
{
|
|
|
|
|
SUB *ptr;
|
|
|
|
|
head=NULL;
|
|
|
|
|
read();
|
|
|
|
|
if(head==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\n\t**********NO RECORDS!**********\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD>γ̱<EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20><>ѧʱ <20>ڿ<EFBFBD>ѧʱ ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>ѧʱ ѧ<><D1A7> <20><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>\n");
|
|
|
|
|
for(ptr=head;ptr;ptr=ptr->next)
|
|
|
|
|
{
|
|
|
|
|
printf("%5d%12s%9s%9d%9d%11d%11d%7d\n",ptr->num,ptr->name,ptr->kind,ptr->stime,ptr->ttime,ptr->etime,ptr->score,ptr->term);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
system("pause");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
void *myInsert(SUB *subj)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
SUB *ptr,*ptr2;
|
|
|
|
|
ptr=subj;
|
|
|
|
|
if(head==NULL)
|
|
|
|
|
{
|
|
|
|
|
head=ptr;
|
|
|
|
|
head->next=NULL;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
for(ptr2=head;ptr2;ptr2=ptr2->next)
|
|
|
|
|
if(ptr2->next==NULL)
|
|
|
|
|
{
|
|
|
|
|
ptr2->next=subj;
|
|
|
|
|
subj->next=NULL;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return head;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
void *insert()
|
|
|
|
|
{
|
|
|
|
|
SUB *ptr,*subj;
|
|
|
|
|
int size=sizeof(SUB);
|
|
|
|
|
char ch,ch1;
|
|
|
|
|
while(ch!='0')
|
|
|
|
|
{
|
|
|
|
|
subj=(SUB *)malloc(size);
|
|
|
|
|
ptr=subj;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀγ<EFBFBD><EFBFBD><EFBFBD>Ϣ:\n");
|
|
|
|
|
printf("\n\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>γ̱<CEB3><CCB1><EFBFBD>:");
|
|
|
|
|
scanf("%d",&subj->num);
|
|
|
|
|
printf("\n\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%s",&subj->name);
|
|
|
|
|
printf("\n\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%s",&subj->kind);
|
|
|
|
|
printf("\n\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧʱ:");
|
|
|
|
|
scanf("%d",&subj->stime);
|
|
|
|
|
printf("\n\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD>ѧʱ:");
|
|
|
|
|
scanf("%d",&subj->ttime);
|
|
|
|
|
printf("\n\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>ϻ<EFBFBD>ѧʱ:");
|
|
|
|
|
scanf("%d",&subj->etime);
|
|
|
|
|
printf("\n\t\t <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>:");
|
|
|
|
|
scanf("%d",&subj->score);
|
|
|
|
|
printf("\n\t\t <20><><EFBFBD><EFBFBD><EFBFBD>뿪<EFBFBD><EBBFAA>ѧ<EFBFBD><D1A7>:");
|
|
|
|
|
scanf("%d",&subj->term);
|
|
|
|
|
myInsert(subj);
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("\n\n <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>밴<EFBFBD>س<EFBFBD>\n");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>밴 0:[ ]\b\b");
|
|
|
|
|
ch1=getchar();
|
|
|
|
|
ch=getchar();
|
|
|
|
|
}
|
|
|
|
|
return head;
|
|
|
|
|
}
|
|
|
|
|
//ɾ<><C9BE>ģ<EFBFBD><C4A3>
|
|
|
|
|
void *del()
|
|
|
|
|
{
|
|
|
|
|
SUB *p1,*p2;
|
|
|
|
|
char ch,ch1;
|
|
|
|
|
int num;
|
|
|
|
|
while(ch!='0')
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD>Ŀγ̱<EFBFBD><EFBFBD><EFBFBD>:[ ]\b\b\b\b");
|
|
|
|
|
scanf("%d",&num);
|
|
|
|
|
if(head->num==num);
|
|
|
|
|
{
|
|
|
|
|
p2=head;
|
|
|
|
|
head=head->next;
|
|
|
|
|
free(p2);
|
|
|
|
|
}
|
|
|
|
|
if(head==NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
p1=head;
|
|
|
|
|
p2=head->next;
|
|
|
|
|
while(p2)
|
|
|
|
|
{
|
|
|
|
|
if(p2->num==num)
|
|
|
|
|
{
|
|
|
|
|
p1->next=p2->next;
|
|
|
|
|
free(p2);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
p1=p2;
|
|
|
|
|
p2=p1->next;
|
|
|
|
|
}
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>س<EFBFBD>\n");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0:[]\b\b");
|
|
|
|
|
ch1=getchar();
|
|
|
|
|
ch=getchar();
|
|
|
|
|
}
|
|
|
|
|
return head;
|
|
|
|
|
system("pause");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//ѡ<>γ<DEBF>ģ<EFBFBD><C4A3>
|
|
|
|
|
void choose()
|
|
|
|
|
{
|
|
|
|
|
SUB *p,*q;
|
|
|
|
|
int a[5];
|
|
|
|
|
int num,total=0,i=0,j;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫѡ<EFBFBD>Ŀγ̱<EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>֮<EFBFBD><D6AE><EFBFBD>ÿո<C3BF><D5B8>ֿ<EFBFBD>\n");
|
|
|
|
|
scanf("%d",&num);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫѡ<EFBFBD>ı<EFBFBD><EFBFBD>ţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0:[]\n\n");
|
|
|
|
|
while(num!=0)
|
|
|
|
|
{
|
|
|
|
|
for(p=head;p;p=p->next)
|
|
|
|
|
if(p->num==num)
|
|
|
|
|
{
|
|
|
|
|
total=total+p->score;
|
|
|
|
|
a[i]=num;
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
scanf("%d",&num);
|
|
|
|
|
}
|
|
|
|
|
if(total<60)
|
|
|
|
|
{
|
|
|
|
|
printf("ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>Ϊ%d,δ<>ﵽ60<36><30>ѡ<EFBFBD><D1A1>ʧ<EFBFBD>ܣ<EFBFBD>",total);
|
|
|
|
|
system("pause");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FILE*fp;
|
|
|
|
|
fp=fopen("3.txt","w");
|
|
|
|
|
for(j=0;j<i;j++)
|
|
|
|
|
for(q=head;q;q=q->next)
|
|
|
|
|
if(q->num==a[j])
|
|
|
|
|
fprintf(fp,"%5d%12s%9s%9d%9d%11d%11d%7d\n",q->num,q->name,q->kind,q->stime,q->ttime,q->etime,q->score,q->term);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("\t\t\n*****ѡ<>ɹ<DEB3><C9B9><EFBFBD>*******\n");
|
|
|
|
|
printf("\n <20><>ѡ<EFBFBD>Ŀγ<C4BF><CEB3><EFBFBD>ѧ<EFBFBD><D1A7>Ϊ%d,<2C>γ̷ֱ<CCB7>Ϊ:\n",total);
|
|
|
|
|
printf("<EFBFBD>γ̱<EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20><>ѧʱ <20>ڿ<EFBFBD>ѧʱ ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>ѧʱ ѧ<><D1A7> <20><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>\n");
|
|
|
|
|
for(j=0;j<i;j++)
|
|
|
|
|
for(q=head;q;q=q->next)
|
|
|
|
|
if(q->num==a[j])
|
|
|
|
|
printf("%5d%12s%9s%9d%9d%11d%11d%7d\n",q->num,q->name,q->kind,q->stime,q->ttime,q->etime,q->score,q->term);
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'3.txt'<27><>\n");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
system("pause");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>涨<EFBFBD><E6B6A8><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
|
|
|
|
|
void search()
|
|
|
|
|
{
|
|
|
|
|
int a,num;
|
|
|
|
|
int t=1;
|
|
|
|
|
char type[10],min[10];
|
|
|
|
|
SUB *ptr;
|
|
|
|
|
L1:system("cls");
|
|
|
|
|
printf("\n\n\t\t***********<2A><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF>ʽ***********\n");
|
|
|
|
|
printf("\n\t\t\t1--<2D><><EFBFBD>γ<EFBFBD><CEB3><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>\n");
|
|
|
|
|
printf("\n\t\t\t2--<2D><><EFBFBD>γ<EFBFBD><CEB3><EFBFBD><EFBFBD>ʲ<EFBFBD><CAB2><EFBFBD>\n");
|
|
|
|
|
printf("\n\t\t\t3--<2D><>ѧ<EFBFBD>ֲ<EFBFBD><D6B2><EFBFBD>\n");
|
|
|
|
|
printf("\n\t\t\t4-<2D>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("\n\n\t\t************************************\n");
|
|
|
|
|
printf("\n\nChoose your numeber(1-4):[]\b\b");
|
|
|
|
|
scanf("%d",&a);
|
|
|
|
|
switch(a)
|
|
|
|
|
{
|
|
|
|
|
case 1:printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҿγ<EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%s",min);
|
|
|
|
|
printf("<EFBFBD>γ̱<EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20><>ѧʱ <20>ڿ<EFBFBD>ѧʱ ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD>ϻ<EFBFBD>ѧʱ ѧ<><D1A7> <20><><EFBFBD><EFBFBD>ѧʱ\n");
|
|
|
|
|
for(ptr=head;ptr;ptr=ptr->next)
|
|
|
|
|
if(strcmp(min,ptr->name)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("%5d%12s%9s%9d%9d%11d%11d%7d\n",ptr->num,ptr->name,ptr->kind,ptr->stime,ptr->ttime,ptr->etime,ptr->score,ptr->term);
|
|
|
|
|
t=0;
|
|
|
|
|
}
|
|
|
|
|
if(t)
|
|
|
|
|
printf("\t\n δ<>ҵ<EFBFBD><D2B5><EFBFBD>\n");
|
|
|
|
|
t=1;
|
|
|
|
|
system("pause");
|
|
|
|
|
goto L1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 2:printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҿγ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%s",type);
|
|
|
|
|
printf("<EFBFBD>γ̱<EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20><>ѧʱ <20>ڿ<EFBFBD>ѧʱ ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD>ϻ<EFBFBD>ѧʱ ѧ<><D1A7> <20><><EFBFBD><EFBFBD>ѧʱ\n");
|
|
|
|
|
for(ptr=head;ptr;ptr=ptr->next)
|
|
|
|
|
if(strcmp(type,ptr->kind)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("%5d%12s%9s%9d%9d%11d%11d%7d\n",ptr->num,ptr->name,ptr->kind,ptr->stime,ptr->ttime,ptr->etime,ptr->score,ptr->term);
|
|
|
|
|
t=0;
|
|
|
|
|
}
|
|
|
|
|
if(t)
|
|
|
|
|
printf("\t\n δ<>ҵ<EFBFBD><D2B5><EFBFBD>\n");
|
|
|
|
|
t=1;
|
|
|
|
|
system("pause");
|
|
|
|
|
goto L1;
|
|
|
|
|
|
|
|
|
|
case 3:printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ҵĿγ̵<EFBFBD>ѧ<EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%d",&num);
|
|
|
|
|
printf("<EFBFBD>γ̱<EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20><>ѧʱ <20>ڿ<EFBFBD>ѧʱ ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD>ϻ<EFBFBD>ѧʱ ѧ<><D1A7> <20><><EFBFBD><EFBFBD>ѧʱ\n");
|
|
|
|
|
for(ptr=head;ptr;ptr=ptr->next)
|
|
|
|
|
if(ptr->score==num)
|
|
|
|
|
{
|
|
|
|
|
printf("%5d%12s%9s%9d%9d%11d%11d%7d\n",ptr->num,ptr->name,ptr->kind,ptr->stime,ptr->ttime,ptr->etime,ptr->score,ptr->term);
|
|
|
|
|
t=0;
|
|
|
|
|
}
|
|
|
|
|
if(t)
|
|
|
|
|
printf("\n\tδ<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
t=1;
|
|
|
|
|
system("pause");
|
|
|
|
|
goto L1;
|
|
|
|
|
|
|
|
|
|
case 4:break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD>涨<EFBFBD><E6B6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>
|
|
|
|
|
void Mangers()
|
|
|
|
|
{
|
|
|
|
|
int n,w=1,flag=0,i=3;
|
|
|
|
|
char s[8];
|
|
|
|
|
char password[7]="1";//<2F><><EFBFBD><EFBFBD>Ϊ1
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
printf("\n\nEnter password:");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
scanf("%s",s);
|
|
|
|
|
if(!strcmp(s,password))//<2F><><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>֤
|
|
|
|
|
{
|
|
|
|
|
flag=1;
|
|
|
|
|
break;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("\n\nError!You only have %d times!Pleasa enter again:\n",i-1);
|
|
|
|
|
i--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
while(i>0);
|
|
|
|
|
if(!flag)
|
|
|
|
|
{
|
|
|
|
|
printf("you have already entered 3 times!");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>볬<EFBFBD><EBB3AC>3<EFBFBD>Σ<EFBFBD><CEA3>˳<EFBFBD>
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
system("cls");//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
puts("\n\n\t\t*************<2A><> <20><> Ա <20><> <20><>**************\n\n");
|
|
|
|
|
puts("\t\t\t\t1--<2D><><EFBFBD><EFBFBD><EFBFBD>γ<EFBFBD>\n");
|
|
|
|
|
puts("\t\t\t\t2--<2D><>ѯ<EFBFBD>γ<EFBFBD>\n");
|
|
|
|
|
puts("\t\t\t\t3--<2D><><EFBFBD>ӿγ<D3BF>\n");
|
|
|
|
|
puts("\t\t\t\t4--ɾ<><C9BE><EFBFBD>γ<EFBFBD>\n");
|
|
|
|
|
puts("\t\t\t\t5--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>");
|
|
|
|
|
puts("\n\n\t\t******************************************\n");
|
|
|
|
|
printf("choose your number(1-5):[]\b\b");
|
|
|
|
|
scanf("%d",&n);
|
|
|
|
|
switch(n)
|
|
|
|
|
{
|
|
|
|
|
case 1:prin();break;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
case 2:search();break;//<2F><>ѯ
|
|
|
|
|
case 3:insert();savefile();break;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
case 4:del();savefile();break;//ɾ<><C9BE>
|
|
|
|
|
case 5:return;
|
|
|
|
|
default:;
|
|
|
|
|
}
|
|
|
|
|
}while(w==1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>涨<EFBFBD><E6B6A8>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void Students()
|
|
|
|
|
{
|
|
|
|
|
int n,w=1;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
puts("\n\n\t\t**********************************\n\n");
|
|
|
|
|
puts("\t\t\t\t1--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>пγ<D0BF>\n");
|
|
|
|
|
puts("\t\t\t\t2--<2D><>ѯ<EFBFBD>γ<EFBFBD><CEB3><EFBFBD>Ϣ\n");
|
|
|
|
|
puts("\t\t\t\t3--ѡ<><D1A1>ѡ<EFBFBD>γ<DEBF>\n");
|
|
|
|
|
puts("\t\t\t\t4--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>Ŀγ<C4BF>\n");
|
|
|
|
|
puts("\t\t\t\t5--ɾ<><C9BE><EFBFBD><EFBFBD>ѡ<EFBFBD>γ<EFBFBD>\n");
|
|
|
|
|
puts("\t\t\t\t6--<2D><><EFBFBD><EFBFBD>");
|
|
|
|
|
puts("\n\n\t\t****************************************\n");
|
|
|
|
|
printf("choose your number(1-6):[]\b\b");
|
|
|
|
|
scanf("%d",&n);
|
|
|
|
|
switch(n)
|
|
|
|
|
{
|
|
|
|
|
case 1:prin();break;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
case 2:search();break;//<2F><>ѯ
|
|
|
|
|
case 3:choose();break;//ѡ<><D1A1>
|
|
|
|
|
case 4:prin1();break;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>
|
|
|
|
|
case 5:del();savefile();break;//ɾ<><C9BE><EFBFBD><EFBFBD>ѡ
|
|
|
|
|
case 6:return;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
default:;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
while(w==1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>༭<EFBFBD><E0BCAD>ҳ<EFBFBD><D2B3>
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
system("color F1");
|
|
|
|
|
int n,w=1;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
system("cls");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ
|
|
|
|
|
puts("\n\n\t\t****************MENU****************\n\n");
|
|
|
|
|
puts("\t\t\t\t1.<2E>Թ<EFBFBD><D4B9><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ݵ<EFBFBD>¼\n");
|
|
|
|
|
puts("\t\t\t\t2.<2E><>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>¼\n");
|
|
|
|
|
puts("\t\t\t\t3.<2E>˳<EFBFBD>");
|
|
|
|
|
puts("\n\n\t\t***********************************\n");
|
|
|
|
|
printf("Choose your number(1--3):[ ]\b\b");
|
|
|
|
|
scanf("%d",&n);
|
|
|
|
|
switch(n)
|
|
|
|
|
{
|
|
|
|
|
case 1:Mangers();break;//ѡ1<D1A1><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Աϵͳ
|
|
|
|
|
case 2:Students();break;//ѡ2<D1A1><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>ϵͳ
|
|
|
|
|
case 3:w=0;break;//ѡ3<D1A1><33><EFBFBD>˳<EFBFBD>
|
|
|
|
|
default:;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
while(w==1);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|