int mp(int a[],size_t zn)
{
//求数组里的最大数
int n =zn / sizeof(int);//数组一共有几个数
int sum=0;
for (int i = 0; i <= n - 1; i++)
{
sum = a[i] + sum;//计算总和
}
int pj;
pj=sum / n;//输出平均值
int max=a[0],min=a[0];
for (int i = 0; i <= n - 1; i++)
{
if (max < a[i])
{
max = a[i];
}
if (min > a[i])
{
min = a[i];
}
}
char b;
b = printf_s("平均数为:%d,最大值为:%d,最小值为:%d", pj, max, min);
return b;
}
int main()
{
int arr[5];
for(int i =0;i<5;i++)
{
scanf_s("%d", &arr[i]);
}
char n = mp(arr, sizeof(arr));
printf("%s", n);
return 0;
}