|
|
|
|
#include"stdio.h"
|
|
|
|
|
#include"windows.h"
|
|
|
|
|
#include"conio.h"
|
|
|
|
|
#include"stdlib.h"
|
|
|
|
|
#include"string.h"
|
|
|
|
|
int menu();
|
|
|
|
|
int menu_select();
|
|
|
|
|
void tj();
|
|
|
|
|
void cx();
|
|
|
|
|
int xg();
|
|
|
|
|
void xs();
|
|
|
|
|
void fd();
|
|
|
|
|
void pm();
|
|
|
|
|
float fm();
|
|
|
|
|
int pass();
|
|
|
|
|
int average();
|
|
|
|
|
int wenjiandiaochu();
|
|
|
|
|
int mima();
|
|
|
|
|
int i,j,k,y;
|
|
|
|
|
FILE *fp;
|
|
|
|
|
struct stu
|
|
|
|
|
{
|
|
|
|
|
int xh;
|
|
|
|
|
char name[30];
|
|
|
|
|
float score;
|
|
|
|
|
};struct stu s[100];
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
system("color F4");//<2F><><EFBFBD>ף<EFBFBD><D7A3><EFBFBD>
|
|
|
|
|
system("pause");
|
|
|
|
|
int e;
|
|
|
|
|
e=mima();
|
|
|
|
|
if(e==1)
|
|
|
|
|
return 0;
|
|
|
|
|
printf("\n");
|
|
|
|
|
printf("\t*-*-*-*-*-*-*-*-*-*-*-*-*-*\n");
|
|
|
|
|
printf("\t* <20><><EFBFBD><EFBFBD>Ӵ<EFBFBD><D3B4> *\n");
|
|
|
|
|
printf("\t* <20><>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *\n");
|
|
|
|
|
printf("\t* ѧ<><D1A7>C<EFBFBD><43><EFBFBD>Գɼ<D4B3><C9BC><EFBFBD>¼<EFBFBD><C2BC>ϵͳ *\n");
|
|
|
|
|
printf("\t* *^_^* *\n");
|
|
|
|
|
printf("\t* *^<5E><>ӭʹ<D3AD><CAB9>^* *\n");
|
|
|
|
|
printf("\t*-*-*-*-*-*-*-*-*-*-*-*-*-*\n");
|
|
|
|
|
printf("\n");
|
|
|
|
|
menu();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int menu()//<2F>˵<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
int n=0;
|
|
|
|
|
char c,a;
|
|
|
|
|
n=menu_select();
|
|
|
|
|
|
|
|
|
|
switch(n)
|
|
|
|
|
{
|
|
|
|
|
case 0: tj(); break;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
case 1: xg(); break;// <20><EFBFBD>
|
|
|
|
|
case 2: xs(); break;//<2F><>ʾ
|
|
|
|
|
case 3: cx();break;//<2F><>ѯ
|
|
|
|
|
case 4: pm();break;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
case 5: fm();break;//<2F><><EFBFBD>ߺ<EFBFBD><DFBA><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
|
|
|
|
case 6: average();break;//ƽ<><C6BD><EFBFBD><EFBFBD>
|
|
|
|
|
case 7: pass();break;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
case 8: fd();break;//ѧ<><D1A7><EFBFBD>ɼ<EFBFBD><C9BC>ֶ<EFBFBD>
|
|
|
|
|
case 9: return 0;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
if(0<=n&&n<=8)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>N\n");
|
|
|
|
|
a=getchar();
|
|
|
|
|
scanf("%c",&c);
|
|
|
|
|
|
|
|
|
|
if(c=='y'||c=='Y')
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
menu();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while(c!='y'&&c!='Y'&&c!='n'&&c!='N')
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺\n");
|
|
|
|
|
scanf("%c",&c);
|
|
|
|
|
getchar();
|
|
|
|
|
if(c=='y'||c=='Y')
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
menu();
|
|
|
|
|
}
|
|
|
|
|
if(c=='n'||c=='N')
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int menu_select()//<2F>˵<EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
{int a;
|
|
|
|
|
printf("\n");
|
|
|
|
|
printf("\t*-*-*-*-*-*-*-*-*-*-*-*-*-*\n");
|
|
|
|
|
printf("\t*-0. <20><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ -*\n");
|
|
|
|
|
printf("\t*-1. <20><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ -*\n");
|
|
|
|
|
printf("\t*-2. <20><>ʾѧ<CABE><D1A7><EFBFBD><EFBFBD>Ϣ -*\n");
|
|
|
|
|
printf("\t*-3. <20><>ѯѧ<D1AF><D1A7><EFBFBD><EFBFBD>Ϣ -*\n");
|
|
|
|
|
printf("\t*-4. ѧ<><D1A7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD> -*\n");
|
|
|
|
|
printf("\t*-5. <20><><EFBFBD>ߺ<EFBFBD><DFBA><EFBFBD><EFBFBD>ͷ<EFBFBD> -*\n");
|
|
|
|
|
printf("\t*-6. ƽ<><C6BD><EFBFBD><EFBFBD> -*\n");
|
|
|
|
|
printf("\t*-7. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -*\n");
|
|
|
|
|
printf("\t*-8. ѧ<><D1A7><EFBFBD>ɼ<EFBFBD><C9BC>ֶ<EFBFBD> -*\n");
|
|
|
|
|
printf("\t*-9. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -*\n");
|
|
|
|
|
printf("\t*-*-*-*-*-*-*-*-*-*-*-*-*-*\n");
|
|
|
|
|
printf("\n\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>빦<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><>ѡ0~9:\n");
|
|
|
|
|
scanf("%d",&a);
|
|
|
|
|
getchar();//<2F><><EFBFBD>ջس<D5BB><D8B3><EFBFBD>
|
|
|
|
|
while(!(a>=0&&a<=9))
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŷ<EFBFBD><EFBFBD><EFBFBD>鷳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%d",&a);
|
|
|
|
|
getchar();
|
|
|
|
|
}
|
|
|
|
|
return a;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int xg() //<2F><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
FILE *fp1;
|
|
|
|
|
char st[30];
|
|
|
|
|
int num,k,x,id;
|
|
|
|
|
float nu;
|
|
|
|
|
system("cls");
|
|
|
|
|
wenjiandiaochu();
|
|
|
|
|
if((fp1=fopen("ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.txt","r"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD>ӵð취<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
fscanf(fp1,"%d",&k);
|
|
|
|
|
fclose(fp1);
|
|
|
|
|
printf("ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>밴1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>밴2,ĪҪѡ<D2AA><D1A1><EFBFBD>ˣ<EFBFBD>\n");
|
|
|
|
|
scanf("%d",&x);
|
|
|
|
|
while(x!=1&&x!=2)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺\n");
|
|
|
|
|
scanf("%d",&x);
|
|
|
|
|
}
|
|
|
|
|
if(x==1)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ijɼ<EFBFBD><EFBFBD>˵<EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>\n");
|
|
|
|
|
scanf("%d",&num);
|
|
|
|
|
for(int i=0;i<k;i++)
|
|
|
|
|
{
|
|
|
|
|
if(num==s[i].xh)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>\n");
|
|
|
|
|
scanf("%d",&id);
|
|
|
|
|
s[i].xh=id;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",st);
|
|
|
|
|
strcpy(s[i].name,st);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD>ijɼ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%f",&nu);
|
|
|
|
|
getchar();
|
|
|
|
|
s[i].score=nu;
|
|
|
|
|
fp=fopen("student.txt","w+");
|
|
|
|
|
for(i=0;i<k;i++)
|
|
|
|
|
fprintf(fp,"%d %s %.1f\n",s[i].xh,s[i].name,s[i].score);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("<EFBFBD>㶨\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("ð<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
if(x==2)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ijɼ<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",st);
|
|
|
|
|
for(int i=0;i<k;i++)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(s[i].name,st)==0)
|
|
|
|
|
{
|
|
|
|
|
char str[30];
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>\n");
|
|
|
|
|
scanf("%d",&id);
|
|
|
|
|
s[i].xh=id;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",st);
|
|
|
|
|
strcpy(s[i].name,st);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD>ijɼ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%f",&nu);
|
|
|
|
|
getchar();
|
|
|
|
|
for(i=0;i<k;i++)
|
|
|
|
|
fprintf(fp,"%d %s %.1f\n",s[i].xh,s[i].name,s[i].score);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("<EFBFBD>㶨\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("ð<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void cx()//<2F><>ѯ
|
|
|
|
|
{
|
|
|
|
|
FILE *fp1;
|
|
|
|
|
char st[30];
|
|
|
|
|
int x,num,k=0;
|
|
|
|
|
wenjiandiaochu();
|
|
|
|
|
system("cls");
|
|
|
|
|
if((fp1=fopen("ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.txt","r"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD>ӵð취<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
fscanf(fp1,"%d",&k);
|
|
|
|
|
fclose(fp1);
|
|
|
|
|
|
|
|
|
|
printf("ѧ<EFBFBD>Ų<EFBFBD>ѯ<EFBFBD>밴1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD>밴2<EFBFBD><EFBFBD>ĪҪѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
scanf("%d",&x);
|
|
|
|
|
while(x!=1&&x!=2)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺\n");
|
|
|
|
|
scanf("%d",&x);
|
|
|
|
|
}
|
|
|
|
|
if(x==1)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>\n");
|
|
|
|
|
scanf("%d",&num);
|
|
|
|
|
for(int i=0;i<k;i++)
|
|
|
|
|
if(num==s[i].xh)
|
|
|
|
|
{
|
|
|
|
|
printf("ѧ<EFBFBD>ţ<EFBFBD>%d\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD>ɼ<EFBFBD><EFBFBD><EFBFBD>%.1f\n",s[i].xh,s[i].name,s[i].score);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
printf("ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(x==2)
|
|
|
|
|
{printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%s",st);
|
|
|
|
|
for(int i=0;i<k;i++)
|
|
|
|
|
if(strcmp(s[i].name,st)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("ѧ<EFBFBD>ţ<EFBFBD>%d\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD>ɼ<EFBFBD><EFBFBD><EFBFBD>%.1f\n",s[i].xh,s[i].name,s[i].score);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
printf("ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void tj()//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
{ FILE *fp1;
|
|
|
|
|
system("cls");
|
|
|
|
|
int i,j,c;
|
|
|
|
|
int a=1;
|
|
|
|
|
if((fp=fopen("student.txt","a"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD>ӵð취<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
for(i=0;a!=0;)
|
|
|
|
|
{
|
|
|
|
|
int d,x;
|
|
|
|
|
float z;
|
|
|
|
|
char st[30];
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>\n");
|
|
|
|
|
scanf("%d",&x);
|
|
|
|
|
getchar();
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
gets(st);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD>ijɼ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%f",&z);
|
|
|
|
|
getchar();
|
|
|
|
|
fprintf(fp,"%d %s %.1f\n",x,st,z);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%d",&d);
|
|
|
|
|
getchar();//<2F><><EFBFBD>ܻس<DCBB>
|
|
|
|
|
a=d;
|
|
|
|
|
while(a!=1&&a!=0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺\n");
|
|
|
|
|
scanf("%d",&a);
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
|
|
|
|
|
if((fp1=fopen("ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.txt","r"))==NULL)//<2F><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.txt<78>ļ<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD>ӵð취<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
fscanf(fp1,"%d",&j);
|
|
|
|
|
fclose(fp1);
|
|
|
|
|
rewind(fp1);
|
|
|
|
|
if((fp1=fopen("ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.txt","w"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD>ӵð취<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
c=j+i;
|
|
|
|
|
fprintf(fp1,"%d",c);
|
|
|
|
|
fclose(fp1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void xs()//<2F><>ʾ
|
|
|
|
|
{ system("cls");
|
|
|
|
|
int ch;
|
|
|
|
|
if((fp=fopen("student.txt","r"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>\n");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
printf("\t\t\tȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("\t****************\n");
|
|
|
|
|
printf("\t*ѧ<><D1A7> name <20>ɼ<EFBFBD>*\n");
|
|
|
|
|
printf("\t****************\n");
|
|
|
|
|
while(!feof(fp))
|
|
|
|
|
{
|
|
|
|
|
ch=fgetc(fp);
|
|
|
|
|
putchar(ch);
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void pm()//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
wenjiandiaochu();
|
|
|
|
|
int i=0,k,m=0,a;
|
|
|
|
|
char c;
|
|
|
|
|
float average,pass,sum=0;
|
|
|
|
|
struct stu t;
|
|
|
|
|
FILE *fp1;
|
|
|
|
|
system("cls");
|
|
|
|
|
if((fp1=fopen("ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.txt","r"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD>ӵð취<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
fscanf(fp1,"%d",&k);
|
|
|
|
|
fclose(fp1);
|
|
|
|
|
for(i=0;i<k;i++)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
for(j=i+1;j<k+1;j++)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if(s[i].score<s[j].score)
|
|
|
|
|
{
|
|
|
|
|
t=s[i];
|
|
|
|
|
s[i]=s[j];
|
|
|
|
|
s[j]=t;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for(i=0;i<k;i++)
|
|
|
|
|
{ /* sum=sum+s[i].score;
|
|
|
|
|
if(s[i].score>=60)
|
|
|
|
|
m++; */
|
|
|
|
|
printf("\t\t\t<EFBFBD><EFBFBD>%d<><64>:%d %-4s %.1f\n",i+1,s[i].xh,s[i].name,s[i].score);
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD>Ƿ<EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><EFBFBD>棬<EFBFBD><EFBFBD><EFBFBD>밴1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>밴0<EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%d",&a);
|
|
|
|
|
c=getchar();//<2F><><EFBFBD>ջس<D5BB>
|
|
|
|
|
while(a!=1&&a!=0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺\n");
|
|
|
|
|
scanf("%d",&a);
|
|
|
|
|
}
|
|
|
|
|
if(a==1)
|
|
|
|
|
{
|
|
|
|
|
if((fp=fopen("student.txt","w+"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD>ӵð취<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
for(int l=0;l<k;l++)
|
|
|
|
|
{
|
|
|
|
|
fprintf(fp,"%d %s %.1f",s[l].xh,s[l].name,s[l].score);
|
|
|
|
|
fprintf(fp,"\n");
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD>㶨<EFBFBD><EFBFBD>\n");
|
|
|
|
|
fclose(fp);
|
|
|
|
|
if(a==0)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*average=sum/i;
|
|
|
|
|
pass=m/i;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ſγ<EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳ɼ<EFBFBD><EFBFBD>ǣ<EFBFBD>%d",s[0]);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ſγ<EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳɼ<EFBFBD><EFBFBD>ǣ<EFBFBD>%d",s[i]);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ſγ<EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD><EFBFBD>ǣ<EFBFBD>%d",average);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ſγ<EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>%d",pass);*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void fd()//<2F>ɼ<EFBFBD><C9BC>ֶ<EFBFBD>
|
|
|
|
|
{ int k;
|
|
|
|
|
FILE *fp1;
|
|
|
|
|
system("cls");
|
|
|
|
|
wenjiandiaochu();
|
|
|
|
|
if((fp1=fopen("ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.txt","r"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD>ӵð취<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
fscanf(fp1,"%d",&k);
|
|
|
|
|
fclose(fp1);
|
|
|
|
|
printf("\t\t\t 90<39><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ!\n");
|
|
|
|
|
printf("\t\t\tѧ<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ɼ<EFBFBD><C9BC><EFBFBD>\n");
|
|
|
|
|
for(i=0;i<k;i++)
|
|
|
|
|
if(s[i].score>=90)
|
|
|
|
|
printf("\t\t\t%d %s %.1f%ld\n",s[i].xh,s[i].name,s[i].score);
|
|
|
|
|
printf("\n\n");
|
|
|
|
|
printf("\t\t\t 80<38><30>89<38><39>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ!\n");
|
|
|
|
|
printf("\t\t\tѧ<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ɼ<EFBFBD><C9BC><EFBFBD>\n");
|
|
|
|
|
for(i=0;i<k;i++)
|
|
|
|
|
if(s[i].score<90&&s[i].score>=80)
|
|
|
|
|
printf("\t\t\t%d %s %.1f%ld\n",s[i].xh,s[i].name,s[i].score);
|
|
|
|
|
printf("\n\n");
|
|
|
|
|
printf("\t\t\t 60<36><30>79<37><39>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ!\n");
|
|
|
|
|
printf("\t\t\tѧ<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ɼ<EFBFBD><C9BC><EFBFBD>\n");
|
|
|
|
|
for(i=0;i<k;i++)
|
|
|
|
|
if(s[i].score>=60&&s[i].score<80)
|
|
|
|
|
printf("\t\t\t%d %s %.1f%ld\n",s[i].xh,s[i].name,s[i].score);
|
|
|
|
|
printf("\n\n");
|
|
|
|
|
printf("\t\t\t 60<36><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ!\n");
|
|
|
|
|
printf("\t\t\tѧ<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ɼ<EFBFBD><C9BC><EFBFBD>\n");
|
|
|
|
|
for(i=0;i<k;i++)
|
|
|
|
|
if(s[i].score<60)
|
|
|
|
|
printf("\t\t\t%d %s %.1f%ld\n",s[i].xh,s[i].name,s[i].score);
|
|
|
|
|
printf("\n\n");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int wenjiandiaochu()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
FILE *fp;
|
|
|
|
|
if((fp=fopen("student.txt","a+"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
for(i=0;!feof(fp);)
|
|
|
|
|
{
|
|
|
|
|
fscanf(fp,"%d%s%f",&s[i].xh,&s[i].name,&s[i].score);
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float fm()//<2F><><EFBFBD>߷<EFBFBD><DFB7><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
FILE *fp1;
|
|
|
|
|
int k;
|
|
|
|
|
float max,min,sum=0;
|
|
|
|
|
wenjiandiaochu();
|
|
|
|
|
system("cls");
|
|
|
|
|
if((fp1=fopen("ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.txt","r"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD>ӵð취<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
fscanf(fp1,"%d",&k);
|
|
|
|
|
fclose(fp1);
|
|
|
|
|
max=s[0].score;
|
|
|
|
|
min=s[0].score;
|
|
|
|
|
for(int i=1;i<k;i++)
|
|
|
|
|
{
|
|
|
|
|
if(s[i].score>max)
|
|
|
|
|
max=s[i].score;
|
|
|
|
|
if(s[i].score<min)
|
|
|
|
|
min=s[i].score;
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>߷֣<EFBFBD>%.1f\n<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ͷ֣<EFBFBD>%.1f\n",max,min);
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int average()//ƽ<><C6BD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
FILE *fp1;
|
|
|
|
|
system("cls");
|
|
|
|
|
wenjiandiaochu();
|
|
|
|
|
float k,c,sum=0;
|
|
|
|
|
if((fp1=fopen("ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.txt","r"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD>ӵð취<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
fscanf(fp1,"%f",&k);
|
|
|
|
|
fclose(fp1);
|
|
|
|
|
for(int i=1;i<k;i++)
|
|
|
|
|
{
|
|
|
|
|
sum=sum+s[i].score;
|
|
|
|
|
}
|
|
|
|
|
c=sum/k;
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ǰѧ<EFBFBD><EFBFBD>C<EFBFBD><EFBFBD><EFBFBD>Գɼ<EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>%.2f\n",c);
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int pass()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
FILE *fp1;
|
|
|
|
|
system("cls");
|
|
|
|
|
wenjiandiaochu();
|
|
|
|
|
float k,c,p=0;
|
|
|
|
|
int i;
|
|
|
|
|
if((fp1=fopen("ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.txt","r"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD>ӵð취<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
fscanf(fp1,"%f",&k);
|
|
|
|
|
fclose(fp1);
|
|
|
|
|
for(i=0;i<k;i++)
|
|
|
|
|
{
|
|
|
|
|
if(s[i].score>=60)
|
|
|
|
|
p++;
|
|
|
|
|
}
|
|
|
|
|
c=p/k;
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ǰѧ<EFBFBD><EFBFBD>C<EFBFBD><EFBFBD><EFBFBD>Գɼ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>%.2f\n",c);
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int mima()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
char m[10],c;
|
|
|
|
|
int i;
|
|
|
|
|
printf("\n\n\n\n\t\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8λ<EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
for(i=0;i<8;i++)
|
|
|
|
|
{
|
|
|
|
|
m[i]=getch();
|
|
|
|
|
printf("$");
|
|
|
|
|
}
|
|
|
|
|
c=getchar();//<2F><><EFBFBD>ջس<D5BB><D8B3><EFBFBD>
|
|
|
|
|
m[i]='\0';//<2F>ÿո<C3BF><D5B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>i+n<><6E><EFBFBD><EFBFBD>
|
|
|
|
|
printf("\n");
|
|
|
|
|
if(strcmp(m,"14789632")==0)
|
|
|
|
|
return 0;
|
|
|
|
|
if(strcmp(m,"14789632")!=0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD><EFBFBD>ѽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļǴ<EFBFBD><EFBFBD><EFBFBD>Ŷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>Σ<EFBFBD>\n");
|
|
|
|
|
for(i=0;i<8;i++)
|
|
|
|
|
{
|
|
|
|
|
m[i]=getch();
|
|
|
|
|
printf("$");
|
|
|
|
|
}
|
|
|
|
|
c=getchar();//<2F><><EFBFBD>ջس<D5BB><D8B3><EFBFBD>
|
|
|
|
|
m[i]='\0';//<2F>ÿո<C3BF><D5B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>i+n<><6E><EFBFBD><EFBFBD>
|
|
|
|
|
printf("\n");
|
|
|
|
|
if(strcmp(m,"14789632")==0)
|
|
|
|
|
return 0;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<EFBFBD>˳<EFBFBD>\n");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|