728x90
반응형
#include <iostream>
using namespace std;
int main(){
int nt;
float sum=0, count=0;
int n;
cin >> nt;
cout << fixed;
cout.precision(3);
for(int i = 0 ; i < nt ; i++){
cin >> n;
int tmp[n];
count = 0;
for(int j = 0 ; j < n ; j++){
cin >> tmp[j];
sum += tmp[j];
}
for(int j = 0 ; j < n ; j++){
if( sum/n < tmp[j]) count++;
}
cout << (count/n)*100 << "%" << endl;
sum = 0;
}
}
https://www.acmicpc.net/problem/4344
728x90
반응형
'Problem Solving' 카테고리의 다른 글
1-6. Pascal's Triangle (LeetCode 118) (0) | 2021.07.07 |
---|---|
1-5. Plus One (LeetCode 66) (0) | 2021.07.07 |
1-3. Assign Cookies (LeetCode 455) (0) | 2021.07.07 |
1-2. 스킬트리 (프로그래머스 summer/winter coding 2018) (0) | 2021.07.07 |
1-1. 음계 판별하기 (백준 2920) (2) | 2021.07.07 |
댓글