问题解决
#include "stdio.h"
#include "conio.h"
struct student
{ char name[8];
int score[3];
int avr;
}stu[10];
main()
{
int i,j,sum,q;
float avr2[5];
/*input*/
for(i=0;i<10;i++)
{ printf("name:");
scanf("%s",stu[i].name);
sum=0;
for(j=0;j<5;j++)
{
printf("score %d.",j+1);
scanf("%d",&stu[i].score[j]);
sum+=stu[i].score[j];
}
stu[i].avr=sum/5;
printf("avr=%d\n",stu[i].avr);
}
for(i=0;i<=10;i++)
for(j=0;j<5;j++)
{if(stu[i].score[j]<60){
q++;
if(q>3)
printf("lj:%s\n",stu[i].name);
}
}
for(i=0;i<3;i++)
{
for(j=0;j<2;j++)
{
avr2[i]+=stu[j].score[i];
}
avr2[i]=avr2[i]/10.0;
printf("the avr is %f\n",avr2[i]);
}
getch();
}