#include<stdio.h>
int main()
{
int arr[]={2,3,5,9,12,24};
int changdu;
int num=0;
changdu=sizeof(arr)/sizeof(int);
int (*p)[changdu];
p=&arr;
printf("数组的长度是%d\n",changdu);
for(int i=0;i<changdu;i++)
{
num=num+(*p)[i];
}
printf("这个数组的和是%d\n",num);
printf("这个数组的平均是%d\n",num/changdu);
return 0;
} |
|