#include
#include
typedef struct stu{
int id;
char name[40];
int mark[4];
float total;
} STU;
int id;
int m1,m2,m3,m4;
char str[40];
void main()
{
int i,j,N=0;
FILE *fin, *fout;
STU tmp;
STU *s;
fin = fopen("score.txt","r");
while (1){
if ( fscanf(fin,"%*d %*s %*d %*d %*d %*d") ==EOF) break;
N++;
}
fclose(fin);
s = (STU *) malloc(N * sizeof(STU));
if (!s) {
printf("no enough memory for STUn"); exit(0);
}
fin = fopen("score.txt","r");
for (i=0;i