View Code of Problem 612

#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
    int a[6];
    double sum=0.0;
    while(cin>>a[0])
    {
        sum=0.0;
    for(int i=1;i<6;i++)
        cin>>a[i];
    sort(a,a+6);
    for(int i=1;i<5;i++)
        sum+=a[i];
        cout<<sum/4.0<<endl;
    }
    return 0;
}



Double click to view unformatted code.


Back to problem 612