#include <iostream>
#include<iomanip>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int MAX=50;
int array[MAX], i, largest1, largest2;
int n;
float x,a[100];
cin>>n;
for(i=0;i<n;i++)
{
cin>>a[i];
}
sort(a,a+n);
x=(a[n-1]+a[n-2])/2;
cout<<fixed<<setprecision(1)<<x;
return 0;
}
#include<iomanip>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int MAX=50;
int array[MAX], i, largest1, largest2;
int n;
float x,a[100];
cin>>n;
for(i=0;i<n;i++)
{
cin>>a[i];
}
sort(a,a+n);
x=(a[n-1]+a[n-2])/2;
cout<<fixed<<setprecision(1)<<x;
return 0;
}
No comments:
Post a Comment