朱色虫居
Pages
Home
Featured Posts
2006/10/08
10370-Above Average
/*
"Above Average"
Level:1.5
Date:2006/10/7
技巧: 要印%,要用"%%"
*/
#include
main(){
int n = 0, people = 0, i = 0,p = 0;
float av = 0.0f;
int grade[1000]={0};
scanf("%d",&n);
while(n-- >0){
scanf("%d",&people);
for(i=0;i < people;i++){ scanf("%d",&grade[i]); av += grade[i]; } av/=people; for(i=0;i < people;i++) if(grade[i] > av)
p++;
printf("%.3f%%\n",(float)p/people*100);
av=p=0;
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment