学生成绩包试定义一个结构体管理学生成绩,打印输出所有学生中总成绩的最高分和最低分,以及各单科成绩的最高分和最低分

#include<stdio.h>
typedef struct studentscore
{
char name[10];
int score[5];
}SCORE;
void ScoreInput(SCORE stu[],int n);
int main(void)
{
int n=0;
int min[5];
int max[5];
int namemax[5];
int namemin[5];
printf("Please input the totalnumber of the students:\n");
scanf("%d",&n);
SCORE stu[n];
ScoreInput(stu,n);
int i,j;
for(i=0;i<5;i++)
{
for(j=0;j<n;j++)
{
max[i]=stu[0].score[i];
namemax[i]=0;
if(max[i]<stu[j].score[i])
{
max[i]=stu[j].score[i];
namemax[i]=j;
}
}
}
for(i=0;i<5;i++)
{
for(j=0;j<n;j++)
{
min[i]=stu[0].score[i];
namemin[i]=0;
if(min[i]>stu[j].score[i])
{
min[i]=stu[j].score[i];
namemin[i]=j;
}
}
int totalscore[5],totalmax=0,totalmin=0;
for(i=0;i<n;i++)
totalscore[i]+=stu[n].score[i];
if(totalmax<totalscore[i])
totalmax=totalscore[i];
if(totalmin>totalscore[i])
totalmin=totalscore[i];
printf("Chinese: max:%d %s min:%d %s\n",max[0],stu[namemax[0]].name,min[0],stu[namemin[0]].name);
printf("测试%d\n",max[1]);
printf("测试%d\n",namemax[1]);
printf("测试%d\n",min[1]);
printf("测试\n",namemin[1]);
printf("Math: max:%d %s min:%d %s\n",max[1],stu[namemax[1]].name,min[1],stu[namemin[1]].name);
printf("English: max:%d %s min:%d %s\n",max[2],stu[namemax[2]].name,min[2],stu[namemin[2]].name);
printf("Physics: max:%d %s min:%d %s\n",max[3],stu[namemax[3]].name,min[3],stu[namemin[3]].name);
printf("Chemistry max:%d %s min:%d %s\n",max[4],stu[namemax[4]].name,min[4],stu[namemin[4]].name);
printf("total max:%d min:%d\n",totalmax,totalmin);
return 0;
}
}
void ScoreInput(SCORE stu[],int n)
{
int i;
for(i=0;i<n;i++)
{
printf("Please input the name of the student%d\n",i+1);
scanf("%s",stu[i].name);
printf("Please input his/her score of the Chinese,Math,English,Physics,Chemistry\n");
scanf("%d,%d,%d,%d,%d",&stu[i].score[0],&stu[i].score[1],&stu[i].score[2],&stu[i].score[3],&stu[i].score[4]);
}
}

你这个代码不是写出来了吗,有什么问题?