//Ex5_7.cpp
#include "iostream" 
#include "ctime" 
using namespace std;
const int N=10; 
void fun(float *p,float *p1,float *p2) 
{float sum,max1; 
 sum=max1=*p++; 
 for(int i=1;i<N;i++) 
	{if (max1<*p) max1=*p; 
       sum=sum+*p; 
       p++; 
	} 
 *p1=sum/N;    
 *p2=max1; 
}
void main() 
{float a[10],aver,max,x; 
 srand(time(NULL));
 for(int i=0;i<10;i++)  
	{x=rand() % 100+1; a[i]=x; } 
 for(i=0;i<10;i++) cout<<a[i]<<" ";
 cout<<endl; 
 fun(a,&aver,&max);  
 cout<<"aver="<<aver<<",max="<<max<<endl; 
}  
