#include <stdio.h>
/*
** input less than 10 integers, and find max,min,count the average
*/
int findMax(int a[],int);
int finMin(int a[],int);
int average(a[],int);
int main()
{
int num[10],i;
int max,min,average;
char end;/*if input not end*/
while((end=getchar())!='\n')/*\n means input end*/
{
num[i++]=end-'0';
}
min=findMin(num,i-1);
max=findMax(num,i-1);
average=average(num,i-1);
return 0;
}
int findMax(int a[],int b)
{
int max=0;
for(b;b>0;--b)
max=a[b]>max? a[b]:max;
return max;
}
int findMin(int a[],int b)
{
int min=32767;
for(b;b>0;--b)
min=a[b]<min? a[b]:min;
return min;
}
int average(a[],int b)
{
int avg,total=0,i;
i=b+1;/*total number of integer*/
for(b;b>0;--b)
total+=a[b];
avg=total/i;/*取整了的平均*/
return avg;
}