You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
1.9 KiB

6 years ago
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int i,j,k,y;
FILE *fp;
struct stu {
int num;
char name[30];
double cscore;
};
struct stu s[100];
int fun() { // Ŀ¼<C4BF><C2BC><EFBFBD><EFBFBD>
int n;
system("cls");
printf("\n\n\t\t\t\t<EFBFBD><EFBFBD>ӭʹ<EFBFBD>óɼ<EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD> ");
printf("\n\n\t\t\t");
printf("************ <20><> <20><> *************\n");
printf("\t\t\t[1]<5D><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\n");
printf("\t\t\t[2]<5D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\n");
printf("\t\t\t[3]<5D>޸<EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD>ɼ<EFBFBD>\n");
printf("\t\t\t[4]<5D><>ѯѧ<D1AF><D1A7><EFBFBD><EFBFBD>Ϣ\n");
printf("\t\t\t[5]<5D>ֶ<EFBFBD><D6B6><EFBFBD>ʾѧ<CABE><D1A7><EFBFBD>ɼ<EFBFBD>\n");
printf("\t\t\t[6]<5D><>ѯѧ<D1AF><D1A7>ƽ<EFBFBD><C6BD><EFBFBD>ֺͼ<D6BA><CDBC><EFBFBD><EFBFBD><EFBFBD>\n");
printf("\t\t\t[7]ѧ<><D1A7><EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>\n");
printf("\t\t\t[8]<5D><>ԭ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\n");
printf("\t\t\t[9]<5D>˳<EFBFBD><CBB3>ɼ<EFBFBD><C9BC><EFBFBD>¼<EFBFBD><C2BC>\n");
printf("\t\t\t");
for(i=0; i<32; i++)
printf("-");
printf("\n\n");
printf("\n\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>");
scanf("%d",&n);
return n;
}
void input() {
system("cls");
i=0;
fp=fopen("stuinfo","w");
printf("*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD>š<EFBFBD><C5A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0*\n");
do {
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>");
scanf("%d",&s[i].num);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%s",s[i].name);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> C <20><><EFBFBD>Գɼ<D4B3><C9BC><EFBFBD>");
scanf("%lf",&s[i].cscore);
if(s[i].num!=0)
fprintf(fp,"%d%-4s%.1lf\n",s[i].num,s[i].name,s[i].cscore);
} while(s[i].num!=0);
fclose(fp);
}
void output() {
if((fp=fopen("stuinfo","r"))==NULL) {
printf("<EFBFBD>򲻿<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>\n");
}
printf("\t\t\t ȫ<><C8AB><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>\n");
k=0;
while(fscanf(fp,"%d%s%lf",&s[k].num,s[k].name,&s[k].cscore)!=EOF) {
printf("\t\t\t%d\t%s\t%.1lf\n",s[k].num,s[k].name,s[k].cscore);
k++;
}
fclose(fp);
}
void add() {
system("cls");
i=0;
fp=fopen("stuinfo","a");
printf("*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD>š<EFBFBD><C5A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0*\n");
do {
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>");
scanf("%d",&s[i].num);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%s",s[i].name);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> C <20><><EFBFBD>Գɼ<D4B3><C9BC><EFBFBD>");
scanf("%lf",&s[i].cscore);
if(s[i].num!=0)
fprintf(fp,"%d%-4s%.1lf\n",s[i].num,s[i].name,s[i].cscore);
} while(s[i].num!=0);
fclose(fp);
}