| ||||||||||
| 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:wwwwwwking at 2007-12-13 14:39:18 > #include <stdio.h>
> int main ()
> {
> int t,n,i,j;
> float a[1000],sum,ave,ans;
> scanf ("%d",&t);
> for (i=1;i<=t;i++)
> {
> sum=ave=ans=0.00;
> scanf ("%d",&n);
> for (j=0;j<n;++j)
> {scanf ("%f",&a[j]);
> sum+=a[j];}
> ave=sum/(float)(n);
> for (j=0;j<n;++j)
> if (a[j]>ave) ans+=1.00;
> ans/=(float)(n);
> ans*=100;
> printf ("%.3f%\n",ans);
> }
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator