在数组arr中为什么不能输出相邻两个数字的平均数呢
#include<stdio.h>
int main()
{
int i,n;
int arr1[20] = {1,1,2};
float arr2[19];
float average;
printf("1\n1\n");
for (i = 2; i <20; i++)
{
arr1[i] = arr1[i - 1] + arr1[i - 2];
printf("%d\n",arr1[i]);
n=arr1[i - 1] + arr1[i - 2];
average=(float)n/2;
arr2[i-2]=average;
printf("%f\n",arr2);
}
return 0;
}