#include <stdio.h>
void average(float *p,int n){
float *p_end;
float sum=0,aver;
p_end=p+n-1;
for(;p<=p_end;p++)
sum=sum+(*p);
aver=sum/n;
printf("average=%5.2f\n",aver);
}
void search_1(float (*p)[4],int n){
int i;
printf("The score of No.%d are:\n",n);
for(i=0;i<4;i++)
printf("%7.2f",*(*(p+n)+i));
}
void search_2(float (*p)[4],int n){
int i,j,flag;
for(j=0;j<n;j++){
flag=0;
for(i=0;i<4;i++)
if(*(*(p+j)+i)<60)
flag=1;
printf("\n");
if(flag==1){
printf("No.%d fails,his scores are:\n",j+1);
for(i=0;i<4;i++)
printf("%6.1f",*(*(p+j)+i));
}
}
}
int main(){
float score[3][4]={{65,57,70,60},{58,87,90,81},{90,99,100,98}};
average(*score,12);
search_1(score,2);
search_2(score,3);
return 0;
}