double fun(int a[], int n, int *max, int *min){ int i; double sum = 0; *max = *min = a[0]; for(i = 0; i < n; ++i) { sum += (double)a[i]; if(a[i] > *max) *max = a[i]; if(a[i] < *min) *min = a[i]; } return sum/n;}