#include
#include
struct stu
{
char name[32];
int english;
int chinese;
int math;
.....n门碧迅瞎课程
};
void main(void)
{
int i,score,average;
char NAME;
struct stu *STU[m] //m为已知的学生个数
for(i=0;i
STU = malloc(struct stu);
printf("请输入第%d个学生的姓名",i+1);
scanf("%s",&NAME);
strcpy(STU[1]->name,NAME);
printf("english :")
scanf("%d",&score);
STU[i]->english = score;
...........依次类推
}
printf("要查询的悔空学生姓名:")
scanf("%s",NAME);
for(i = 0,i < m;i++)
{
if(!(strcmpa[i]->name,NAME)
{
average = (STU[i]->english+STU[i]->chinese+STU[i]->昌侍math)/n;
}
}
for(i=0;i
free(a[i]);
}
exit(1);
}
这腔慧个不要赋值,都定义float了,还赋什么初值? float s[100]; 这蚂备个printf语句要移动到这层循环闷圆毁外。 for(i=0;i