代码
#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn = 100000;
int a[maxn + 1];
int main(){
int n;
double mid;
scanf("%d", &n);
for(int i = 0; i < n; i++){
scanf("%d", &a[i]);
}
sort(a, a + n);
if(n % 2 == 0){
mid = (a[n/2] + a[n/2 - 1]) / 2.0;
if((a[n/2] + a[n/2 - 1]) % 2 != 0){
printf("%d %.1lf %d", a[n - 1], mid, a[0]);
}else{
printf("%d %.0lf %d", a[n - 1], mid, a[0]);
}
}else{
mid = a[n/2];
printf("%d %.0lf %d", a[n - 1], mid, a[0]);
}
return 0;
}