Attention:
①注意判断double类型数字是否是整数
②注意double类型的输出方式
#include<bits/stdc++.h>
using namespace std;
const int inf = ~(1u << 31u);
const int maxn = 1000;
int main()
{
ios::sync_with_stdio(false);
int n;
cin >> n;
int max = -inf, min = inf, x, k = n / 2;
double mid = 0;
for(int i = 1; i <= n; ++i){
cin >> x;
if(x > max) max = x;
if(x < min) min = x;
if(k % 2 == 0){
if(i == k) mid += x;
else if(i == k + 1){
mid += x;
mid = mid / 2;
}
}else{
if(i == k + 1)
mid = x;
}
}
int midd = (int)mid;
if(mid - midd == 0)
printf("%d %.0f %d", max, mid, min);
else printf("%d %.1f %d", max, mid, min);
return 0;
}