__sunhy2012__ @ 2024-08-05 08:25:43
#include<bits/stdc++.h>
using namespace std;
long long n;
double a[310],ans;
int main(){
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i];
sort(a+1,a+n+1);
for(int i=2;i<n;i++)
ans+=a[i];
printf("%.2lf",jas/(n-2),);
return 0;
}
by zhangjiahe__ @ 2024-08-05 08:32:35
由于
by zhangjiahe__ @ 2024-08-05 08:33:14
*一定误差最大
by __sunhy2012__ @ 2024-08-05 13:59:53
@zhangjiahe__ 过了,但不完全过了
#include<bits/stdc++.h>
using namespace std;
long long n;
double a[310],ans,d,an;
int main(){
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i];
sort(a+1,a+n+1);
for(int i=2;i<n;i++)
ans+=a[i];
d=ans/(n-2);
an=max(ans/(n-2)-a[2],ans/(n-2)-a[n]-1);
printf("%.2lf %.2lf",d,an);
return 0;
}