#include
# define N 100
float avg(int x[],int n)
{
int i;
float s=0;
for(i=0;i
return s/n;
}
int main()
{
int i,n,a1[N],a2[N];
printf("请输入数组1的元素个数:");
scanf("%d",&n);
printf("请输入%d个数组元素",n);
for(i=0;i
printf("数组1的平均值为%.4f.\n",avg(a1,n));
printf("请输入数组2的元素个数:");
scanf("%d",&n);
printf("请输入%d个数组元素",n);
for(i=0;i
printf("数组2的平均值为%.4f.\n",avg(a2,n));
}