백준 4344

hyun20·2021년 7월 3일
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main() {
	int testN, n;
	double average;
	int score[1000];
	double count;
	cin >> testN;
	for (int i = 0; i < testN; i++) {
		average = 0; count = 0;
		cin >> n;
		for (int j = 0; j < n; j++) { 
			cin >> score[j];
			average += score[j];
		}
		average = average / n;
		for (int j = 0; j < n; j++) {
			if (score[j] > average) count++;
		}
		cout <<fixed<<setprecision(3)<< count / n*100 << "%" << endl;
	}
}

0개의 댓글