Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int t,j,i,a[1000],b;
- double av,sum,n,ans;
- while(scanf("%d",&t)==1)
- {
- for(i=1;i<=t;i++)
- {
- sum=0;
- b=0;
- scanf("%lf",&n);
- for(j=1;j<=n;j++)
- {
- scanf("%d",&a[j]);
- sum=sum+a[j];
- }
- av=sum/n;
- for(j=1;j<=n;j++)
- {
- if(a[j]>av)
- b=b+1;
- }
- ans=(b*100)/n;
- printf("%.3lf%%\n",ans);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement