|
|
|
|
#include<stdio.h>
|
|
|
|
|
#include<stdlib.h>
|
|
|
|
|
#include<string.h>
|
|
|
|
|
#include<conio.h>
|
|
|
|
|
#include <time.h>
|
|
|
|
|
#define load sizeof(student)
|
|
|
|
|
#define N 7
|
|
|
|
|
void read();
|
|
|
|
|
void save();
|
|
|
|
|
int size=3;
|
|
|
|
|
struct student
|
|
|
|
|
{
|
|
|
|
|
char num[10];
|
|
|
|
|
char name[20];
|
|
|
|
|
int scorem,scoreq,scoreg,scorey;
|
|
|
|
|
char ximing[20];
|
|
|
|
|
}stu[N],temp;
|
|
|
|
|
void input()
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\t************<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>************\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,100<30>ɼ<EFBFBD>,Ǧ<><C7A6><EFBFBD>ɼ<EFBFBD>,<2C><><EFBFBD>߳ɼ<DFB3>,<2C><>Զ<EFBFBD>ɼ<EFBFBD>,ϵ<><CFB5>:\n");
|
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
|
scanf("%s%s%d%d%d%d%s",&stu[i].num,&stu[i].name,&stu[i].scorem,&stu[i].scoreq,&stu[i].scoreg,&stu[i].scorey,&stu[i].ximing);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,100<30>ɼ<EFBFBD>,Ǧ<><C7A6><EFBFBD>ɼ<EFBFBD>,<2C><><EFBFBD>߳ɼ<DFB3>,<2C><>Զ<EFBFBD>ɼ<EFBFBD>,ϵ<><CFB5>:\n");
|
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
|
printf("%s\t%s\t%d\t%d\t%d\t%d\t%s\n",stu[i].num,stu[i].name,stu[i].scorem,stu[i].scoreq,stu[i].scoreg,stu[i].scorey,stu[i].ximing);
|
|
|
|
|
}
|
|
|
|
|
void find()
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\t************<2A><><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>************\n");
|
|
|
|
|
char fs[20];
|
|
|
|
|
read();
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%s",&fs);
|
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(stu[i].num,fs)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD>Ҫ<EFBFBD>ҵ<EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD>:\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,100<30>׳ɼ<D7B3>,Ǧ<><C7A6><EFBFBD>ɼ<EFBFBD>,<2C><><EFBFBD>߳ɼ<DFB3>,<2C><>Զ<EFBFBD>ɼ<EFBFBD>,ϵ<><CFB5>:\n");
|
|
|
|
|
printf("%s\t%s\t%d\t%d\t%d\t%d\t%s\n",stu[i].num,stu[i].name,stu[i].scorem,stu[i].scoreq,stu[i].scoreg,stu[i].scorey,stu[i].ximing);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else if(strcmp(stu[i].name,fs)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD>Ҫ<EFBFBD>ҵ<EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD>:\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,100<30>׳ɼ<D7B3>,Ǧ<><C7A6><EFBFBD>ɼ<EFBFBD>,<2C><><EFBFBD>߳ɼ<DFB3>,<2C><>Զ<EFBFBD>ɼ<EFBFBD>,ϵ<><CFB5>:\n");
|
|
|
|
|
printf("%s\t%s\t%d\t%d\t%d\t%d\t%s\n",stu[i].num,stu[i].name,stu[i].scorem,stu[i].scoreq,stu[i].scoreg,stu[i].scorey,stu[i].ximing);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD>Ҫ<EFBFBD>ҵ<EFBFBD><EFBFBD>˶<EFBFBD>Աδ<EFBFBD>ҵ<EFBFBD>:\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>Աȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void paixu()
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\t************<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>************\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ijɼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
|
{
|
|
|
|
|
for(int j=i+1;j<size;j++)
|
|
|
|
|
{
|
|
|
|
|
if(stu[i].scorem<stu[j].scorem)
|
|
|
|
|
{
|
|
|
|
|
temp=stu[i];
|
|
|
|
|
stu[i]=stu[j];
|
|
|
|
|
stu[j]=temp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
|
printf("%s\t%s\t%d\t%d\t%d\t%d\t%s\n",stu[i].num,stu[i].name,stu[i].scorem,stu[i].scoreq,stu[i].scoreg,stu[i].scorey,stu[i].ximing);
|
|
|
|
|
}
|
|
|
|
|
void xiugai()
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\t************<2A>Ľ<DEB8><C4BD><EFBFBD>************\n");
|
|
|
|
|
char ch2[20],c;
|
|
|
|
|
char num[10],name[20];
|
|
|
|
|
int scorem,scoreq,scoreg,scorey,i;
|
|
|
|
|
char ximing[20];
|
|
|
|
|
printf("ԭʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
read();
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%s",ch2);
|
|
|
|
|
for(i=0;i<size;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(stu[i].name,ch2)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("1.<2E>ĺ<DEB8><C4BA><EFBFBD>\n2.<2E><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>\n3.<2E><EFBFBD>100<30>׳ɼ<D7B3>\n4.<2E><EFBFBD>Ǧ<EFBFBD><C7A6><EFBFBD>ɼ<EFBFBD>\n5.<2E><EFBFBD><DEB8><EFBFBD><EFBFBD>߳ɼ<DFB3>\n6.<2E><EFBFBD><DEB8><EFBFBD>Զ<EFBFBD>ɼ<EFBFBD>\n7.<2E><EFBFBD>ϵ<EFBFBD><CFB5>\n");
|
|
|
|
|
scanf("%d",&c);
|
|
|
|
|
switch(c)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%s",&num);
|
|
|
|
|
strcpy(stu[i].num,num);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 2:
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
scanf("%s",&name);
|
|
|
|
|
strcpy(stu[i].name,name);
|
|
|
|
|
break;}
|
|
|
|
|
case 3:
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD>˶<EFBFBD>Ա100<EFBFBD>׳ɼ<EFBFBD>:");
|
|
|
|
|
scanf("%d",&scorem);
|
|
|
|
|
stu[i].scorem=scorem;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>ԱǦ<EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD>:");
|
|
|
|
|
scanf("%d",&scoreq);
|
|
|
|
|
stu[i].scoreq=scoreq;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 5:
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>߳ɼ<EFBFBD>:");
|
|
|
|
|
scanf("%d",&scoreg);
|
|
|
|
|
stu[i].scoreq=scoreq;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 6:
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD>Զ<EFBFBD>ɼ<EFBFBD>:");
|
|
|
|
|
scanf("%d",&scorey);
|
|
|
|
|
stu[i].scorey=scorey;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 7:
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>Աϵ<EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%s",&ximing);
|
|
|
|
|
strcpy(stu[i].ximing,ximing);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
printf("<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");
|
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
|
printf("%s\t%s\t%d\t%d\t%d\t%d\t%s\n",stu[i].num,stu[i].name,stu[i].scorem,stu[i].scoreq,stu[i].scoreg,stu[i].scorey,stu[i].ximing);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
save();
|
|
|
|
|
}
|
|
|
|
|
void defen()
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\t************<2A>÷ֽ<C3B7><D6BD><EFBFBD>************\n");
|
|
|
|
|
int x,y,z,w,o,p,q,i;
|
|
|
|
|
char ch1[20]="jisuanji",ch2[20]="tumu",ch3[20]="yejin";
|
|
|
|
|
printf("ԭʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
read();
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ϵ<EFBFBD>ĵ÷<EFBFBD><EFBFBD>ܷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
for(i=0;i<size;i++)
|
|
|
|
|
{
|
|
|
|
|
if(stu[i].scorem==1) x=3;
|
|
|
|
|
else if(stu[i].scorem==2) x=2;
|
|
|
|
|
else if(stu[i].scorem==3) x=1;
|
|
|
|
|
else x=0;
|
|
|
|
|
|
|
|
|
|
if(stu[i].scoreq==1) y=3;
|
|
|
|
|
else if(stu[i].scoreq==2) y=2;
|
|
|
|
|
else if(stu[i].scoreq==3) y=1;
|
|
|
|
|
else y=0;
|
|
|
|
|
|
|
|
|
|
if(stu[i].scoreg==1) z=3;
|
|
|
|
|
else if(stu[i].scoreg==2) z=2;
|
|
|
|
|
else if(stu[i].scoreg==3) z=1;
|
|
|
|
|
else z=0;
|
|
|
|
|
|
|
|
|
|
if(stu[i].scorey==1) w=3;
|
|
|
|
|
else if(stu[i].scorey==2) w=2;
|
|
|
|
|
else if(stu[i].scorey==3) w=1;
|
|
|
|
|
else w=0;
|
|
|
|
|
}
|
|
|
|
|
for(i=0;i<size;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(stu[i].ximing,ch1)==0)
|
|
|
|
|
{
|
|
|
|
|
o=x+y+z+w;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>ܵ÷<EFBFBD>:%d\n",o);
|
|
|
|
|
}
|
|
|
|
|
else if(strcmp(stu[i].ximing,ch2)==0)
|
|
|
|
|
{
|
|
|
|
|
p=x+y+z+w;
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ľϵ<EFBFBD>ܵ÷<EFBFBD>:%d\n",p);
|
|
|
|
|
}
|
|
|
|
|
else if(strcmp(stu[i].ximing,ch3)==0)
|
|
|
|
|
{
|
|
|
|
|
q=x+y+z+w;
|
|
|
|
|
printf("ұ<EFBFBD><EFBFBD>ϵ<EFBFBD>ܵ÷<EFBFBD>:%d\n",q);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void shanchu()
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\t************ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>************\n");
|
|
|
|
|
char ch1[20];
|
|
|
|
|
printf("ԭʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
read();
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
scanf("%s",&ch1);
|
|
|
|
|
for(i=0;i<size;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(stu[i].name,ch1)==0)
|
|
|
|
|
{
|
|
|
|
|
for(int j=i;j<size-1;j++)
|
|
|
|
|
stu[j]=stu[j+1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
for(i=0;i<size-1;i++)
|
|
|
|
|
{
|
|
|
|
|
printf("%s\t%s\t%d\t%d\t%d\t%d\t%s\n",stu[i].num,stu[i].name,stu[i].scorem,stu[i].scoreq,stu[i].scoreg,stu[i].scorey,stu[i].ximing);
|
|
|
|
|
|
|
|
|
|
}size--;
|
|
|
|
|
save();
|
|
|
|
|
}
|
|
|
|
|
void charu()
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
int a;
|
|
|
|
|
printf("\t************<2A><><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>:");
|
|
|
|
|
scanf("%d",&a);
|
|
|
|
|
for(int j=0;j<a;j++)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%s",&stu[size].num);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%s",&stu[size].name);
|
|
|
|
|
printf("100<EFBFBD>׳ɼ<EFBFBD>:");
|
|
|
|
|
scanf("%d",&stu[size].scorem);
|
|
|
|
|
printf("Ǧ<EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD>:");
|
|
|
|
|
scanf("%d",&stu[size].scoreq);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>߳ɼ<EFBFBD>:");
|
|
|
|
|
scanf("%d",&stu[size].scoreg);
|
|
|
|
|
printf("<EFBFBD><EFBFBD>Զ<EFBFBD>ɼ<EFBFBD>:");
|
|
|
|
|
scanf("%d",&stu[size].scorey);
|
|
|
|
|
printf("ϵ<EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%s",&stu[size].ximing);
|
|
|
|
|
for(int i=0;i<size+1;i++)
|
|
|
|
|
for(int j=i+1;j<size+1;j++)
|
|
|
|
|
if(stu[i].scorem<stu[j].scorem)
|
|
|
|
|
{
|
|
|
|
|
temp=stu[i];
|
|
|
|
|
stu[i]=stu[j];
|
|
|
|
|
stu[j]=temp;
|
|
|
|
|
}
|
|
|
|
|
size++;
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
|
printf("%s\t%s\t%d\t%d\t%d\t%d\t%s\n",stu[i].num,stu[i].name,stu[i].scorem,stu[i].scoreq,stu[i].scoreg,stu[i].scorey,stu[i].ximing);
|
|
|
|
|
save();
|
|
|
|
|
}
|
|
|
|
|
void save()
|
|
|
|
|
{
|
|
|
|
|
FILE *fp; //<2F><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>ָ<EFBFBD><D6B8>
|
|
|
|
|
|
|
|
|
|
if((fp=fopen("e:\\xiao.txt","w"))==NULL) //Ϊ<><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>,Ϊֻд<D6BB><D0B4>ʽ
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>Cannot open the file\n");
|
|
|
|
|
return; //<2F><><EFBFBD><EFBFBD><F2B2BBBF>ز˵<D8B2>
|
|
|
|
|
}
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...Saving the file......\n");
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
|
fprintf(fp,"%s\t%s\t%d\t%d\t%d\t%d\t%s\n",stu[i].num,stu[i].name,stu[i].scorem,stu[i].scoreq,stu[i].scoreg,stu[i].scorey,stu[i].ximing);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>....Save the file successfully!\n");
|
|
|
|
|
}
|
|
|
|
|
void read()
|
|
|
|
|
{
|
|
|
|
|
FILE *fp;//<2F><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>ָ<EFBFBD><D6B8>
|
|
|
|
|
if((fp=fopen("e:\\xiao.txt","r"))==NULL) //Ϊ<><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>,Ϊֻд<D6BB><D0B4>ʽ
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>Cannot open the file\n");
|
|
|
|
|
return; //<2F><><EFBFBD><EFBFBD><F2B2BBBF>ز˵<D8B2>
|
|
|
|
|
}
|
|
|
|
|
fscanf(fp,"<EFBFBD>˶<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,100<30>ɼ<EFBFBD>,Ǧ<><C7A6><EFBFBD>ɼ<EFBFBD>,<2C><><EFBFBD>߳ɼ<DFB3>,<2C><>Զ<EFBFBD>ɼ<EFBFBD>,ϵ<><CFB5>:\n");
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
|
{
|
|
|
|
|
fscanf(fp,"%s\t%s\t%d\t%d\t%d\t%d\t%s\n",&stu[i].num,&stu[i].name,&stu[i].scorem,&stu[i].scoreq,&stu[i].scoreg,&stu[i].scorey,&stu[i].ximing);
|
|
|
|
|
printf("%s\t%s\t%d\t%d\t%d\t%d\t%s\n",stu[i].num,stu[i].name,stu[i].scorem,stu[i].scoreq,stu[i].scoreg,stu[i].scorey,stu[i].ximing);
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
}
|
|
|
|
|
void menu()
|
|
|
|
|
{
|
|
|
|
|
int ch1;
|
|
|
|
|
char ch2;
|
|
|
|
|
struct tm *pt; /*<2A><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ṹ<EFBFBD><E1B9B9>*/
|
|
|
|
|
time_t t;
|
|
|
|
|
t=time(NULL);
|
|
|
|
|
pt=localtime(&t); /*<2A><>ȡϵͳ<CFB5><CDB3><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5>ṹ<EFBFBD><E1B9B9><EFBFBD><EFBFBD>*/
|
|
|
|
|
do{
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD>ǰϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%d-%d-%d\n",pt->tm_year+1900,pt->tm_mon+1,pt->tm_mday);
|
|
|
|
|
printf("======================<3D>˵<EFBFBD>=====================\n");
|
|
|
|
|
printf(" 1.<2E><><EFBFBD><EFBFBD> 2.<2E><><EFBFBD><EFBFBD> \n");
|
|
|
|
|
printf(" 3.<2E><><EFBFBD><EFBFBD> 4.<2E><EFBFBD> \n");
|
|
|
|
|
printf(" 5.<2E>÷<EFBFBD> 6.ɾ<><C9BE> \n");
|
|
|
|
|
printf(" 7.<2E><><EFBFBD><EFBFBD> 8.<2E><><EFBFBD><EFBFBD> \n");
|
|
|
|
|
printf(" 9.<2E><>ʾ 0.<2E>˳<EFBFBD>\n");
|
|
|
|
|
printf("===============================================\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><0-9>:[ ]\b\b");
|
|
|
|
|
scanf("%d",&ch1);
|
|
|
|
|
switch(ch1)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
input();
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
find();
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
paixu();
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
xiugai();
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
defen();
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
shanchu();
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
|
|
|
|
charu();
|
|
|
|
|
break;
|
|
|
|
|
case 8:
|
|
|
|
|
save();
|
|
|
|
|
break;
|
|
|
|
|
case 9:
|
|
|
|
|
read();
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case 0:
|
|
|
|
|
exit(0);
|
|
|
|
|
default:
|
|
|
|
|
printf("δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κβ<EFBFBD><EFBFBD><EFBFBD>!");
|
|
|
|
|
}
|
|
|
|
|
printf("\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>밴y\n");
|
|
|
|
|
getchar();
|
|
|
|
|
scanf("%2c",&ch2);
|
|
|
|
|
}while(ch2=='y');
|
|
|
|
|
}
|
|
|
|
|
int main(void)
|
|
|
|
|
{
|
|
|
|
|
system("color f");
|
|
|
|
|
//Logon();
|
|
|
|
|
menu();
|
|
|
|
|
}
|