程序代码如下:
#include<iostream>
#include<iomanip>
#include<string>
using namespace std;
int main()
{
double a[7],s=0,avg;
string name;
for(int i=0;i<=6;i++)
{
cin>>a[i];
s+=a[i];
if(a[0]<a[i])a[0]=a[i];
if(a[0]>a[i])a[1]=a[i];
}
cin>>name;
s-=(a[0]+a[1]);
avg=s/5.00;
cout<<name<<" "<<setiosflags(ios::fixed)<<setprecision(2)<<avg<<endl;
return 0;
}