Baekjoon 4344

2022. 5. 1. 00:31Baekjoon

int main()
{
int c;
scanf("%d", &c); //테스트 케이스 입력
for (int i = 0; i < c; i++) //테스트 5번반복
{
float student; 
float score[1000] = { 0 }; // 점수저장
float sum = 0; //점수
float avg = 0; // 평균
float answer_count = 0; //정답인 학생카운트

scanf("%f", &student); //학생수 입력
for (int j = 0; j < student; j++)
{

scanf("%f", &score[j]);
sum += score[j]; // 점수합
avg = sum / student; // 평균
}for (int k = 0; k < student; k++)
{
if (avg < score[k])
{
answer_count++;
}
}printf("%.3f%%\n", answer_count/student*100);

}
}

'Baekjoon' 카테고리의 다른 글

Stack 1,2,3,4  (0) 2022.06.22
Baekjoon 1157 문제  (0) 2022.05.02
Baekjoon  (0) 2022.05.01
Baekjoon 8958번  (0) 2022.04.30
2675번  (0) 2022.04.29