printf("highest is %s,%s",stu[maxi].num,stu[maxi].name);
printf("grade is %6.2f,%6.2f,%6.2f,average is %5.2f.\n",
stu[maxi].score[0],stu[maxi].score[1],stu[maxi].score[2],stu[maxi].average);
这两句,数组下标是float。要求数组下标只能是整数或者char
我让你取一个数组中第4.8个元素,你取的出来?
scanf("%f",&stu[i].score); //score定义是数组,你这样用肯定不正确了
printf("highest is %s,%s",stu[maxi].num,stu[maxi].name); //maxi定义是float,下标应该使用int类型
程序还是有点问题的,仔细检查一下吧。
scanf("%f",&stu[i].score);错误。因为stu[i].score本来是地址,你又写了&取地址符号,相当于地址的地址,所以无效