求助这个代码该怎么改(program和end之间部分代码)
/*-------------------------------------------------------
题目:学生的记录由学号和成绩组成,N名学生的数据已放入主函数中的结构体数组s中,
请编写函数fun,其功能是:把分数最高的学生数据放在b所指的数组中。
注意:分数最高的学生可能不止一个,函数返回分数最高的学生的人数。
请勿改动主函数main和其它函数中的任何内容,仅在函数fun的花括号中填入
你编写的若干语句。
-------------------------------------------------------*/
#include <stdio.h>
#define N 16
void wwjt ( );
typedef struct
{
char num[10];
int s;
} STREC;
int fun( STREC *a, STREC *b )
{
/**********Program**********/
int i,j=0,maxi,sum;
int max=STREC[i].s;
for(i=0;i<N;i++)
{
if(STREC.s[i]>max)
{
max=STREC.s[i];
b[j].num=STREC.num[i];
b[j].s=STREC.s[i];
j++;
}
if(STREC.s[i]==max)sum++;
}
return sum;
/********** End **********/****_________
}
void main()
{
STREC s[N]={{"GA05",85},{"GA03",76},{"GA02",69},{"GA04",85},
{"GA01",91},{"GA07",72},{"GA08",64},{"GA06",87},
{"GA015",85},{"GA013",91},{"GA012",64},{"GA014",91},
{"GA011",77},{"GA017",64},{"GA018",64},{"GA016",72}};
STREC h[N];
int i, n;
n=fun( s, h );
printf("The %d highest score :\n", n);
for(i=0; i<n; i++)
printf("%s %4d\n", h[i].num, h[i].s);
printf("\n");
wwjt ( );
}
void wwjt( )
{
FILE *in , *out ;
int i, n, a;
STREC s[N];
STREC h[N];
in=fopen("in.dat", "r");
if(in==NULL)
{
printf("Please Verify The Currernt Dir..It May Be Changed");
}
out=fopen("out.dat", "w");
if(out==NULL)
{
printf("Please Verify The Current Dir.. It May Be Changed");
}
for(a = 0; a < 10; a ++)
{
for(i = 0; i<16; i ++)
{
fscanf(in, "%s %d", &s[i].num, &s[i].s);
}
n=fun( s, h );
fprintf(out, "%d\n", n);
for(i = 0; i < n; i ++)
fprintf(out, "%d\n", h[i].s);
printf("\n");
}
fclose(in);
fclose(out);
}