#include<stdio.h>
#include<stdlib.h>
void main()
{
void average(float *p,int n);
void search(float (*p)[4],int n);
void search1(float (*p)[4]);
float score[3][4]={{1,2,3,4},{5,6,7,8},{9,10,11,12}};
average(*score,12);
search(score,2);
search1(score);
system("pause");
}
void average(float *p,int n)
{
float *pend,sum=0,aver;
pend=p+n-1;
for(;p<=pend;p++)
sum=sum+(*p);
aver=sum/n;
printf("average=%5.2f",aver);
printf("\n");
}
void search(float (*p)[4],int n)
{
int i;
printf("score of No.%d:",n);
for(i=0;i<4;i++)
printf("%5.2f",*(*(p+n-1)+i));
printf("\n");
}
void search1(float (*p)[4])
{
int i,j,flag;
for(i=0;i<3;i++)
{
flag=0;
for(j=0;j<4;j++)
if(*(*(p+i)+j)<60)
flag=1;
if(flag==1)
{
printf("No.%d fails,his score are:",i+1);
for(j=0;j<4;j++)
printf("%5.2f",*(*(p+i)+j));
printf("\n");
}
}
}
07-12
1243
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)