cout<<"The sum of the elements in array is : "<<result_sum<<endl;
cout<<"Tthe average of the elements in array is : "<<result_average<<endl;
cout<<'\n'<<'\n';
return 0;
}
double sum ( float* a , int s ) //求和
{
double f=0 ;
for ( int j=0; j<s; j++)
f=f+a[j];
return f;
}
double average ( double d , int s ) //求平均
{
return ( d / s);
}