#include "stdio.h"
int main(void){
int a[20],i,j,k,sum;
printf("Enter 20 integers...\n");
for(sum=i=0;i<20;scanf("%d",a+i),sum+=a[i++]);
for(i=0;i<20;i++){
for(k=i,j=k+1;j<20;j++)
if(a[k]>a[j]) k=j;
if(k-i)
j=a[k],a[k]=a[i],a[i]=j;
}
printf("The MAX is %d\nThe MIN is %d\n",a[19],a[0]);
printf("The AVERAGE is %g\n",sum/20.0);
for(i=0;i<20;printf("%d ",a[i++]));
printf("\n");
return 0;
}