#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
int arr[10];
int max = 0;
int min = 0;
int sum = 0;
printf("请输入十个数\n");
for (int i = 0; i < 10; i++)
{
scanf("%d",&arr[i]);
}
for (int i = 0; i < 10; i++)
{
max = arr[0];
min = arr[0];
if (max < arr[i])
{
max = arr[i];
}
if (min > arr[i])
{
min = arr[i];
}
sum += arr[i];
}
printf("最大为%d",max);
printf("最小为%d", min);
printf("平均为%d",sum/10);
return 0;
}
标签:10,arr,平均值,min,int,max,最小,printf,若干个
From: https://blog.51cto.com/u_16425777/8966665