View Code of Problem 612

#include<stdio.h>
#include<string.h>
#include<math.h>
#define MAX 1000000+10
#define Max(a,b) a>b?a:b
#define Min(a,b) a<b?a:b
int main()
{
	int a[6];
	while(scanf("%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5])!=EOF)
	{
		int i,j;
		for(i=1;i<6;i++)
		{
			int t=a[i];
			for(j=i-1;j>=0&&a[j]>t;j--)
			{
				a[j+1]=a[j];
			}
			a[j+1]=t;
		}
		int sum=a[1]+a[2]+a[3]+a[4];
		
			printf("%g\n",sum/4.0);
		
			
	
	}

}

Double click to view unformatted code.


Back to problem 612