60 pts!!!

B2095 白细胞计数

Sam_Gamer @ 2023-04-25 12:56:03

#include<bits/stdc++.h>
#define maxn 305
using namespace std;
int n;
double a[maxn],pj,wc,ans;
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n+1);
    a[n]=0;
    a[1]=0;
    for(int i=1;i<=n;i++)
    {
        ans+=a[i];
    }
    pj=ans/(n-2);
    wc=a[n-1]-pj;
    cout<<fixed<<setprecision(2)<<pj<<" "<<wc<<"\n";
    return 0;

}

by Sam_Gamer @ 2023-04-25 13:12:45

杨莉对了


|