View Code of Problem 612

#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;



int main(){
	float a[6];
    while(cin>>a[0]){
        for (int i = 1; i < 6; i++)
        {
            cin>>a[i];
        }
        sort(a,a+6);
        float sum=0;
        for (int i = 1; i < 5; i++)
        {
            sum+=a[i];
        }
        
        cout<<sum/4<<endl;
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 612