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:这题不是多case……In Reply To:这题不是多case…… Posted by:karying at 2010-05-06 22:06:44 > 我用多case,居然是WA…… #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