给n个数求有多少个数均平均数大
#include<bits/stdc++.h>
using namespace std;
void Gao()
{
int n;
double ans1=0.0;
double a[2000],ave=0.0;
cin>>n;
for (int i=0;i<n;i++)
cin>>a[i],ave+=a[i];
ave/=1.0*n;
for (int i=0;i<n;i++)
{
if (a[i]>ave+1e-10)
ans1+=1.0;
}
double ans=ans1/(1.0*n);
ans*=100;
printf("%.3lf\%\n",ans);
}
int main()
{
int T;
cin>>T;
while (T--)
Gao();
return 0;
}