| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:水分很足In Reply To:水分很足 Posted by:4511444260 at 2009-10-17 14:07:54 #include<iostream>
using namespace std;
int main()
{
int x;
scanf("%d",&x);
while(x--){
int n,a[1000],i,j,count=0,t=0;
scanf("%d",&n);
for(i=0;i<n;i++){
cin>>a[i];
t+=a[i];
}
double all=t,count1;
all/=n;
for(j=0;j<n;j++)
if(a[j]>all) count+=1;
count1=count*100;
printf("%.3lf%c\n",count1/n,'%');
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator