#include
const int N=3000;
int n;
double array[N];
double getAverage(double a[])
{
int i;
double sum=0;
for(i=0;i
}
int main()
{
int i;
printf("输入数组的元素个数 n :\n");
scanf("%d",&n);
printf("依次输入n个元素:\n");
for(i=0;i
printf("%.3lf\n",getAverage(array));
return 0;
}
int average(int *a,int n)
{
if(n==0)return 0;
int sum=0,i=0;
for(i;i
return sum/n;
}
int main()
{
int arr[5]=;
printf("%d",sum(arr,5));
return 0;
}
int Avg(int * Arr, int ArrSize){
int i,sum = 0;
for(i=0;i
}
return sum/ArrSize;
}
int average(int *a,int n)
{
if(n==0)return 0;
int sum=0,i=0;
for(i;i
return sum/n;
}
int main()
{
int arr[5]=;
printf("%d",sum(arr,5));
return 0;
}