水题,学会了怎么打印%
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int C;
scanf("%d",&C);
while(C--)
{
int N,k=0;
double a[1050],s=0;
scanf("%d",&N);
for(int i=0;i<N;i++)
{
scanf("%lf",&a[i]);
s+=a[i];
}
double aver=s/(double)N;
//printf("%lf",aver);
for(int i=0;i<N;i++)
if(a[i]>aver)
k++;
printf("%.3lf%%",(double)k/(double)N*100.0);
if(C)
printf("\n");
}
}