Created
January 17, 2019 16:32
-
-
Save godtaehee/a33db3ff08f0349e3b5116b8498674f2 to your computer and use it in GitHub Desktop.
C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(){ | |
int T, N, avg; | |
int sum = 0; | |
scanf("%d", &T); | |
while(T--){ | |
scanf("%d", &N); | |
if(N < 1 || N > 1000) | |
break; | |
int score[N]; | |
int count = 0; | |
for(int i = 0; i < N; i++){ | |
scanf("%d", &score[i]); | |
if(score[i] < 0 || score[i] > 100) | |
return 0; | |
sum += score[i]; | |
} | |
avg = sum / N; | |
sum = 0; | |
for(int i = 0; i < N; i++){ | |
if(score[i] > avg){ | |
count++; | |
} | |
} | |
printf("%.3lf%%\n", ((double)count / N) * 100); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment