C语言求助~
这程序结果死活不对不知道是哪里错了望各位大师指点~#include<stdio.h>voidaver(float*p,intn);voidsearch(float(*p)...
这程序结果死活不对 不知道是哪里错了 望各位大师指点~
#include<stdio.h>
void aver(float *p,int n);
void search(float (*p)[4]);
void main()
{
void average(float *p,int n);
void search(float (*p)[4]);
int s[3][4]={{65,67,70,60},{80,87,90,81},{90,99,100,98}};
average(*s,12);
search(s,2);
}
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("the average is %5.2f\n",aver);
}
void search(float (*p)[4],int n)
{
int i;
printf("the score of NO. %d are:\n",n);
for(i=0;i<4;i++)
printf("%5.2f",*(*(p+n)+i));
} 展开
#include<stdio.h>
void aver(float *p,int n);
void search(float (*p)[4]);
void main()
{
void average(float *p,int n);
void search(float (*p)[4]);
int s[3][4]={{65,67,70,60},{80,87,90,81},{90,99,100,98}};
average(*s,12);
search(s,2);
}
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("the average is %5.2f\n",aver);
}
void search(float (*p)[4],int n)
{
int i;
printf("the score of NO. %d are:\n",n);
for(i=0;i<4;i++)
printf("%5.2f",*(*(p+n)+i));
} 展开
展开全部
#include<stdio.h>
void average(float *p,int n);
void search(float (*p)[4],int n);
void int main()
{
float s[3][4]={{65,67,70,60},{80,87,90,81},{90,99,100,98}};
average(*s,12);
search(s,2);
}
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("the average is %5.2f\n",aver);
}
void search(float (*p)[4],int n)
{
int i;
printf("the score of NO. %d are:\n",n);
for(i=0;i<4;i++)
printf("%5.2f",*(*(p+n)+i));
}
void average(float *p,int n);
void search(float (*p)[4],int n);
void int main()
{
float s[3][4]={{65,67,70,60},{80,87,90,81},{90,99,100,98}};
average(*s,12);
search(s,2);
}
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("the average is %5.2f\n",aver);
}
void search(float (*p)[4],int n)
{
int i;
printf("the score of NO. %d are:\n",n);
for(i=0;i<4;i++)
printf("%5.2f",*(*(p+n)+i));
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询