求问一道C语言编程题

2024-12-31 15:58:51
推荐回答(2个)
回答1:

#include
#include
int main(void)
{
int N;
double sum,*p;
char i;
sanf("%d",&N);
if(N<10)
{
printf("There is no numbers.\n");
}
else
{
p=(double*)calloc(N,sizeof(double));
for(i=0;i {
sum+=*(p+i);
}
printf("%g\n%g",sum,sum/N);
}
free(p);
return 0;
}

回答2:

给个邮箱,发给你