void main()
{/*二维数组*/
int i,j,a[3][5],b[3];
float temp_all=0,temp_c=0,s=0;
char *c[5]={"张三","王五","李四","赵六","周八"};
char *t[3]={"math","c","foxpro"};
//void change(int a[],int t);
for(i=0;i<5;i++)
{
printf("input %s 's score:",c[i]);
for(j=0;j<3;j++)
{
scanf("%d",&b[j]);
a[j][i] = b[j];
temp_c += b[j];
temp_all += a[j][i];
}
printf("%s 's average:%f \n",c[i],temp_c/3);
temp_c = 0;
}
printf("all_average:%f \n",temp_all/15);
for(j=0;j<3;j++)
{
for(i=0;i<5;i++)
{
s += a[j][i];
}
printf("%s average:%f \n",t[j],s/5);
s = 0;
}
去看c结构体这一张,这是例题
结构体