View Code of Problem 612

#include<iostream>
using namespace std;
int main()
{
	double n1, n2,n3,n4,n5,n6;
	while(cin >> n1 >> n2 >> n3 >> n4 >> n5 >> n6)
	{
		int ma = max(n1,max(n2,max(n3,max(n4,max(n5,n6)))));
		int mi = min(n1,min(n2,min(n3,min(n4,min(n5,n6)))));
		cout << (n1+n2+n3+n4+n5+n6-ma-mi)/4 << endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 612